Skip to content

tinyjin/both-require

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Require to both way of relatively and absolutely.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published