- The main file of the module should be named
index.js
. - Initialize the module by running
npm init --scope=<your-scope>
. - Install local module with
npm install --save <path-to-module>
.
Local module resides in lib/custom-module
, the scope of the module should be marcuslilja
.
- Run
npm init --scope=marcuslilja
inlib/custom-module
. - Run
npm install --save lib/custom-module
.
var customModule = require('@marcuslilja/custom-module');