Options
All
  • Public
  • Public/Protected
  • All
Menu

@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).

Index

Type aliases

FileSystem

FileSystem: Pick<"fs", "readFileSync" | "writeFileSync" | "unlinkSync">

FunctionModule

FunctionModule: function

Type declaration

    • (...args: any[]): any
    • Parameters

      • Rest ...args: any[]

      Returns any

KeyedObject

KeyedObject: object

Type declaration

  • [key: number]: any

LoadModuleFunction

LoadModuleFunction: function

Type declaration

ObjectModule

ObjectModule: any

ProxiableModule

ProxiableModule: object | function & KeyedObject

ResolveFilenameFunction

ResolveFilenameFunction: function

Type declaration

    • Parameters

      Returns string

Variables

Const debug

debug: IDebugger = Debug('lazy-require')

Const trace

trace: (Anonymous function) = doTrace ? debug : (...args: any[]) => {}