$ gnpm install load-module
Standard dynamic imports intended for runtime loading of user-defined modules (e.g. plugins).
import { loadModule } from 'load-module'
const ViewClass = await loadModule('default-view', { paths: '~/my-view-folder'})
const view = new ViewClass()
Kind: exported function
Param | Type | Description |
---|---|---|
specifier | string |
A valid Node.js module specifier. |
options.paths | string[] |
One or more directories to pass to both loadModuleResolvedFrom and loadModuleRelativeTo . |
options.resolvedFromPaths | string[] |
Specific directories to pass to loadModuleResolvedFrom . |
options.relativeToPaths | string[] |
Specific directories to pass to loadModuleRelativeTo . |
Kind: exported function
Param | Type | Description |
---|---|---|
specifier | string |
A valid Node.js module specifier. |
Kind: exported function
Param | Type | Description |
---|---|---|
specifier | string |
A valid Node.js module specifier. |
paths | string | Array.<string> |
One or more additional directories from which to resolve the supplied specifier from. |
Kind: exported function
Param | Type | Description |
---|---|---|
specifier | string |
A valid module path. |
paths | string | Array.<string> |
One or more additional directories in which to search for the supplied module path. |
© 2017-21 Lloyd Brookes <75pound@gmail.com>.
Tested by test-runner. Documented by jsdoc-to-markdown.
Copyright 2013 - present © cnpmjs.org | Home |