rooty

2.0.0 • Public • Published

rooty

Allow root-of-project (closest package.json) requires in node with ^

Usage

Require rooty as the first thing in your entry file:

 
var rooty = require('rooty');
 
rooty();
 
// more app code
 

Can also take an optional root path

 
rooty('./server');
 

And then, instead of:

 
var something = require('../../../../../something');
 

You can use:

 
var something = require('^something');
 

Package Sidebar

Install

npm i rooty

Weekly Downloads

1,561

Version

2.0.0

License

MIT

Last publish

Collaborators

  • mauricebutler
  • korynunn