Skip to content

serapath/rootrelative

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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')
;

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors