June 2016
Beginner to intermediate
376 pages
8h 23m
English
In Node.js, modules are either stored in a single file, as discussed previously, or as a directory with particular characteristics. There are several ways to specify module names and several ways to organize module deployment in the filesystem. It's quite flexible, especially when used with the npm package management system for Node.js.
Generally speaking, the module name is a pathname but with the file extension removed. Earlier, when we wrote require('./simple'), Node.js knew to add .js to the filename and load in simple.js.
Modules whose filenames end in .js are of course expected to be written in JavaScript. Node.js also supports binary code native libraries as Node.js ...
Read now
Unlock full access