To answer your first question, the way you load a module is depending on the module entry point and the main parameter of the package.json.
Let's say you have the following file structure:
my-npm-module
|-- lib
| |-- module.js
|-- package.json
Without main parameter in the package.json, you have to load the module by giving the module entry point: require('my-npm-module/lib/module.js')
.
If you set the package.json main parameter as follows "main": "lib/module.js"
, you will be able to load the module this way: require('my-npm-module')
.