Allows to require project files as absolute paths, relative to the root of your node project.
Allows to require project files as absolute paths, relative to the root of your node project. Because how often you're using absolute path in your requires? :)
// override requirevar require = require('project-require');// use it to require everything else,// and using absolute path, but relative// to the project's rootvar common = require('/lib/common');// instead ofvar worksToo = require('../../../lib/common');// in rare case when full path needed to be requiredvar anotherLib = require.thru('/real/absolute/path');
- Meant for the projects with deep nested structure.
- Doesn't affect other modules or files
- Not meant to be used in shared modules, just for apps