Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tpkn/aliasmo

Require NodeJs module using alias
https://github.com/tpkn/aliasmo

Last synced: 6 days ago
JSON representation

Require NodeJs module using alias

Awesome Lists containing this project

README

        

# Aliasmo [![npm Package](https://img.shields.io/npm/v/aliasmo.svg)](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": {

}
}
```