Node.js Packages
Let's see how the Node platform provides a way to structure an application under the form of a package.
We'll cover the following...
Anatomy of a package
Technically, a package is a folder containing the following elements:
- A
package.jsonfile that describes the application and its dependencies. - A entry point into the application, defaulting to the
index.jsfile. - A
node_modules/subfolder, which is the default place where Node looks for modules to be loaded into the application. - All the other files forming the source code of the application.
The package.json file
...Ask