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

import-lazy

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

import-lazy

Import a module lazily

  • 4.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11M
increased by2.84%
Maintainers
1
Weekly downloads
 
Created

What is import-lazy?

The import-lazy npm package allows for lazy-loading of modules in Node.js. This means that modules are only loaded when they are actually used in the code, which can significantly improve the startup time of applications by reducing the initial load time.

What are import-lazy's main functionalities?

Lazy-loading of CommonJS modules

This feature allows you to lazy-load CommonJS modules. The module is only loaded when a method of the module is called, as demonstrated with the lodash library.

const importLazy = require('import-lazy')(require);
const _ = importLazy('lodash');
console.log(_.isString('hello'));

Lazy-loading of ES Modules

This feature supports lazy-loading of ES Modules. Similar to the CommonJS example, the ES Module is loaded only when a method is invoked.

import importLazy from 'import-lazy';
const _ = importLazy(() => import('lodash-es'));
console.log(_.isString('hello'));

Other packages similar to import-lazy

Keywords

FAQs

Package last updated on 27 Apr 2019

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