Local Modules
It is possible to add code from your local source code to your node_modules folder by including it as a dependency in your package.json. Once you've done this you can require them from any file in your project without providing a path:
// so last week
// let local_file = require("../../../service_rest/routes/main_route");
// so this week
let local_module = require("main_route");
It can be a little annoying when you are actively developing your local modules as you'll need to regularly clear and re-install your node_modules. But this isn't bad to fix with gulp.js and some clever scripting.
Resources
- The code in this folder
- Arnaud's article.