June 2014
Intermediate to advanced
696 pages
38h 52m
English
In the previous sections, you learned how to create and publish a Node.js module. This section provides an example of actually using a Node.js module inside your Node.js applications. Node.js makes this extremely simple. All you need to do is install the module into your application structure and then use the require() method to load the module.
The require() method accepts either an installed module name or a path to a .js file that is located on the file system. For example:
require("censorify")require("./lib/utils.js")
The .js filename extension is optional. If it is omitted, then Node.js will search for it.
Follow these steps to see how easy this process is:
1. Create a project folder ...
Read now
Unlock full access