node. js v8.11.1
node. JS v8.11.1 Documentation
Today, I took a cursory look at the official files of node. js, and learned a lot about the API of most modules and made a simple note of their usage scenarios.
Assert assertion
Individuals feel that writing business code is rarely used, and can be used to do some unusual seizures. It should be handy to write a test module.
Buffer buffer
Used to do binary data flow related processing, may be used in the network communication protocol at the bottom of the more
Event Generator
Feeling is the core feature of node. Response through an asynchronous event. The event allows you to register your own events and trigger them at the appropriate time.
Cluster cluster
Node is single-process single-threaded and uses multicore CPUs to improve concurrent processing. The cluster module is the creation of multiple node process ' clusters ', which enables communication cooperation between processes. It is estimated to be involved when writing the server's underlying architecture.
Console,error Console, exception handling
Throw error, Conosle.log, Console.error. Various debug, abnormal handling encountered.
FS, OS, path operating system, file operation related
There are different implementations for different operating systems, basically a unified API. Manipulate files, get system information, file directory.
Process Current Processes
Gets information about the current node process. is a global variable. Some properties are equivalent to the properties of the OS. The scheduling between processes may be used in conjunction with cluster.
Child_process Child Process
Pay attention to the difference with the process. Child_process is a child process that node executes a system command to open. Equivalent to other languages of system, popen, exec, etc. Execute some shell scripts directly or something.
Stream flow
Many of the modules in node are implementations of stream, such as the return result of child_process execution, the byte stream that the file reads, and so on. Should always be used with piping pipe
Dgram and net datagrams and networks
Both Dgram and net have socket implementations, Dgram for the UDP protocol, and net for the TCP protocol. The implementation of the socket method is basically the same. You will need to write your own client or server.
Crypto, Util, dns,string_decoder some tool class modules
are encryption, common tools, domain name resolution, character encoding. A util.inherits prototype chain inheritance in the tool class is worth noticing.
Url,querystring,module,global,timer
Slightly
Nodejs Documentation Overview