Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/node-core-library > Import

Import class

Helpers for resolving and importing Node.js modules.

Signature:

export declare class Import 

Methods

MethodModifiersDescription
lazy(moduleName, require)staticProvides a way to improve process startup times by lazy-loading imported modules.
resolveModule(options)staticThis resolves a module path using similar logic as the Node.js require.resolve() API, but supporting extra features such as specifying the base folder.
resolveModuleAsync(options)staticAsync version of Import.resolveModule().
resolvePackage(options)staticPerforms module resolution to determine the folder where a package is installed.
resolvePackageAsync(options)staticAsync version of Import.resolvePackage().