Loading and using modules
The Node designers believe that most modules should be developed in userland—by developers, for developers. Such an effort is made to limit the growth of the standard library. Node's standard library contains the following short list of modules:
Network and I/O |
Strings and Buffers |
Utilities |
---|---|---|
TTY UDP/Datagram HTTP HTTPS Net DNS TLS/SSL Readline FileSystem |
Path Buffer Url StringDecoder QueryString |
Utilities VM Readline Domain Console Assert |
Encryption and Compression |
Environment |
Events and Streams |
ZLIB Crypto PunyCode |
Process OS Modules |
Child Processes Cluster Events Stream |
Modules are loaded via the global require
statement, which accepts the module name or path as a single argument. You are encouraged to augment the module ecosystem by creating new modules or new combinations of modules.
The module system itself is implemented in the require
(module
) module.
Understanding the module object
A Node module is simply a JavaScript file expected to...