https://github.com/serapath/rootrelative
enable require(rootRelativePath) by using an absolute path starting from the projects root directory
https://github.com/serapath/rootrelative
Last synced: 11 months ago
JSON representation
enable require(rootRelativePath) by using an absolute path starting from the projects root directory
- Host: GitHub
- URL: https://github.com/serapath/rootrelative
- Owner: serapath
- License: mit
- Created: 2015-01-15T20:22:48.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-01-20T20:12:25.000Z (over 11 years ago)
- Last Synced: 2025-02-14T17:42:09.490Z (over 1 year ago)
- Language: JavaScript
- Size: 125 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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')
;
```