npm require use local file code example
Example 1: How to get the path to the file that required your module?
module.parent
Example 2: npm can i use my modules without specifying the path
npm install --save ../path/to/mymodule
module.parent
npm install --save ../path/to/mymodule