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

effortless-require

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

effortless-require

Effortlessly require node libraries

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-42.86%
Maintainers
1
Weekly downloads
 
Created
Source



Build Status Coverage Status semantic-release Bharath Rule

effortless-require

Effortlessly require node libraries, providing a more flexible way of requiring libraries and modules in your project.

Installation

$ npm install effortless-require --save

Features

  • Require only once, at your application's start, and it will be globally available, everywhere.
  • Say goodbye to ugly relative paths.

Usage


// Node Packages
// Before
const express = require('express');
const moment = require('moment');

// Now
require('effortless-require')();
const [express, moment] = need('express', 'moment');
});

// Relative JS modules
// Before
const moduleOne = require('../../modules/path/to/moduleOne');
const moduleTwo = require('../../../modules/path/to/moduleTwo');

// Now
require('effortless-require')({ basePath: __dirname }) // Set `basePath` to your project's root folder, for example.
const [
  moduleOne,
  moduleTwo
] = need('path/to/moduleOne', 'path/to/moduleTwo');

License

MIT © Bharathvaj Ganesan

Keywords

FAQs

Package last updated on 31 Dec 2017

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