both-require

1.0.1 • Public • Published

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, Blog

License

This project has MIT License.

Package Sidebar

Install

npm i both-require

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

3.11 kB

Total Files

4

Last publish

Collaborators

  • tinyjin