1.0.1 • Published 9 years ago

rootrelative v1.0.1

Weekly downloads
3
License
ISC
Repository
-
Last release
9 years ago

rootrelative

enable require(rootRelativePath) by using an absolute path starting from the projects root directory npm install rootrelative

consider the following project structure:

  • myProject/
    • index.js
    • lib/
      • index.js
      • abc.js
      • def.js
      • helper/
        • xyz.js

xyz.js

var my = require('rootrelative');
var
  myProject = require(my('')),
  abc       = require(my('lib/abc.js'),
  lib       = require(my('lib')
;
1.0.1

9 years ago

1.0.0

9 years ago