rute
v1.0.1
Published
Allows you to require stuff from your project root
Downloads
3
Readme
rute
A node module that allows you to require stuff from your project root.
Usage
This will get the module at process.cwd()/middleware.js
or
process.cwd()/middleware/index.js
var middleware = require('rute')('middleware');
You can also change where the root that it starts from Note that the arguments get passed into path.resolve. Make sure that the path you put in is an absolute path.
require('rute').root(__dirname, '../');
Note that you can only call .root()
successfully once, and you must do it
before you use it to require anything using rute
. This prevents any
unexpected behavior when trying to change the root that rute
used. I may be
convinced in the future to make a more dynamic system.
Issues
I accept pull requests (as long as it doesn't detract from the original purpose of the module)
It shouldn't be do hard to understand the code. It less lines of code than this README.