https://github.com/tpkn/aliasmo
Require NodeJs module using alias
https://github.com/tpkn/aliasmo
Last synced: 10 months ago
JSON representation
Require NodeJs module using alias
- Host: GitHub
- URL: https://github.com/tpkn/aliasmo
- Owner: tpkn
- License: mit
- Created: 2019-04-23T18:37:07.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-13T17:09:40.000Z (about 6 years ago)
- Last Synced: 2024-09-25T09:28:00.174Z (over 1 year ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Aliasmo [](https://www.npmjs.org/package/aliasmo)
Require NodeJs modules using alias
:warning: Tested only on CommonJS system, and not too far in deep.
## API
```javascript
require('aliasmo')();
// or without modifying package.json file
require('aliasmo')({
"@root": ".",
"@config": "./config.js",
"@routes": "routes/",
"@util": "modules/util"
});
```
### package.json
```json
{
"name": "app",
"version": "0.0.1",
"main": "app.js",
"aliases": {
"@root": ".",
"@config": "./config.js",
"@routes": "routes/",
"@util": "modules/util"
},
"dependencies": {
}
}
```