rooted
Requiring modules/folders/files in the right way
Installation
npm i rooted --save
Usage
////// badvar data = ;var helpers = ; ///// good// will build the path starting from the root directory of your application// and require the respective file/folder/modulevar rooted = ;var data = ;var helpers = ;
You can also get string representing the absolute path of the file/folder, passing true
as the second argument.
var rooted = ;var data = ; console; // "string"
Tests
make test
License
MIT License © Eric Douglas