https://github.com/tinyjin/both-require
Require to both way of relatively and absolutely.
https://github.com/tinyjin/both-require
Last synced: 10 months ago
JSON representation
Require to both way of relatively and absolutely.
- Host: GitHub
- URL: https://github.com/tinyjin/both-require
- Owner: tinyjin
- License: mit
- Created: 2018-08-06T06:39:57.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-07T01:37:43.000Z (over 7 years ago)
- Last Synced: 2024-10-07T09:03:44.071Z (over 1 year ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# both-require
Require to both way of relatively and absolutely.
## Intro
both-require was born for solving **require hell** as you can see below.
```
const moduleA = require('../../../../moduleA');
```
and then you can use relative path, additionally. because of support both way path.
## Install
```
npm install both-require --save
```
## How to use
### require using absoulte path
```
const use = require('both-require');
const moduleA = use('moduleA');
```
### require using relative path
```
const use = require('both-require');
const moduleB = use('./moduleB'); //It's the same to pure require.
```
## Advantage
If used both-require, able to split code of require public module & private module, intuitively.
```
const use = require('both-require');
const pubModule = require('pubModule');
const priModule = use('priModule');
```
## Authors
tinyjin - [Github](https://github.com/tinyjin), [Blog](http://jinui.kr)
## License
This project has MIT License.