node-pathify
v1.0.5
Published
Alias path from root json file
Downloads
4
Readme
#Installation
npm i node-pathify
#Config Create paths.js file on root folder
root
- paths.js
- node_modules
- app
- controllers
- ...
- models
- schemas
- ...
Export your aliases
// paths.js example
module.exports = {
"schemas": __dirname + '/app/models/schemas',
"controllers": __dirname + '/app/controllers',
"utils": __dirname + '/app/utils',
"ressources": __dirname + '/app/ressources',
"config": __dirname + '/config',
"uploads": __dirname + '/public/uploads'
};
#How to use
// app/controllers/foo.js
const _P = require('node-pathify');
const FooSchema = require( _P.schemas + '/foo' );
...