0.4.0 • Published 8 years ago
alias-require v0.4.0
alias-require
use require('@alias/file.js') to require a local file without the ../../../ problem
usage
index.js
const alias = require('alias-require');
alias({
root: __dirname
});
require('./path/to/a/module');
path/to/a/module.js
require('@root/another/path/to/a/module');
another/path/to/a/module.js
console.log('YEAH!!');