1. Global objects
2. Common Tools
3. Event mechanism
4. File system access
5.HTTP Service and Client
I. Global object, as with the Window object
Process ==> global variable, an object that describes the state of the current node. JS process, provides a simple interface for an operating system
1.PROCESS.ARGV ==> command line parameter array, the first element is node, the second element is the script file name, the third element starts each element is a run parameter
2.process.stdout ==> standard output stream, usually we use Console.log () to print characters to the standard output, while the Process.stdout.write () function provides a lower level interface.
3.process.stdin ==> is the standard input stream, initially it is paused, to read data from the standard input, you must resume the stream and manually write the stream's event response function.
The function of the 4.process.nexttick (callback) ==> is to set a task for the event loop, and node. JS calls callback the next time the event loops over the response.
function dosomething (args, callback) { somethingcomplicated (args); Callback (); } dosomething (function onEnd () { compute ();});//Process.nexttick () provides a tool to break up complex work into smaller events. The rewritten program splits the time-consuming operation into two events, reducing the execution times of each event and increasing the response speed of the event. function dosomething (args, callback) { somethingcomplicated (args); Process.nexttick (callback); } dosomething (function onEnd () {
5. Besides, the process also shows the methods of Process.platform, Process.pid, Process.execpath, Process.memoryusage (), etc.
Two. Common Tools util
1.util.inherits ==> between Objects 2.util.inspect ==> is a method of converting any object to a string, typically for debugging and error output. It accepts at least one parameter, object, which is to be converted. ShowHidden is an optional parameter, and if the value is true, more hidden information will be output. 3. Four types of test Tools 3.util.isarray () 4.util.isregexp () 5.util.isdate () 6.util.iserror () 7.util.format () 8.util.debug ()
Http://nodejs.org/api/util.html Learn more.
10.node.js Core Modules