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
Modules whose filenames end in