Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lazy-require

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lazy-require

Lazy require allows you to require modules lazily, meaning that when you lazy require a missing module, it is automatically installed. If the installation or require fails, the error is returned to the lazy require callback.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
20K
decreased by-9.11%
Maintainers
1
Weekly downloads
 
Created
Source

Lazy Require

Build Status NPM version Flattr this project

Lazy require allows you to require modules lazily, meaning that when you lazy require a missing module, it is automatically installed. If the installation or require fails, the error is returned to the lazy require callback.

Install

  1. Install Node.js
  2. npm install --save lazy-require

Usage

// Import
var lazyRequire = require('lazy-require').lazyRequire;

// Load a module lazily
lazyRequire('iconv', function(err,iconv){
	// Check
	if (err)  return console.log('iconv failed to load because of:', err.stack);
	
	// Success
	// iconv....
});

History

You can discover the history inside the History.md file

License

Licensed under the incredibly permissive MIT License
Copyright © 2013+ Bevry Pty Ltd

Keywords

FAQs

Package last updated on 24 Jun 2013

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