node-use-require
Node require absolute path. Simply Easy Smaller < 1Kb
Problem
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const mysql =
Those suck for maintenance and they're ugly. link
Install
npm install node-use-require --save
How to use
globaluse =
or
const use =
Example
-root
--app
----db
------mysql.js
------mongoose.js
----routes
------group
---------subGroup
------------router.js
--server.js
--node_module
--package.json
When router.js
require mysql.js
relative path
const mysql =
When router.js
require mysql.js
absolute path
const use = const mysql =
Authors
- Nonthachai Korninai - Github
License
This project is licensed under the MIT License