New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

both-require

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

both-require

Require to both way of relatively and absolutely

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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.

Keywords

FAQs

Package last updated on 07 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc