Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@salesforce/lazy-require

0.3.3 • Public • Published

@salesforce/lazy-require

A Node library for lazily loading commonjs modules in order to speed up application execution time.

Note that not all modules are well-suited for lazy loading -- some modules expect to run essential initialization code in addition to exporting types when loaded (BAD!). Modules that do this should not be lazily loaded, or undefined results are likely to occur in your application. Use with care (that is, make sure your app is well tested before using this in production).

Usage

TypeScript

JavaScript

// Enable lazy loading of modules
const lazyLoad = require('@salesforce/lazy-require').default.create('name-of-typecache');
lazyLoad.start();

Keywords

none

Install

npm i @salesforce/lazy-require

DownloadsWeekly Downloads

21,765

Version

0.3.3

License

BSD-3-Clause

Unpacked Size

34 kB

Total Files

16

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar