{"name":"load-module","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"5.0.0","description":"Standard dynamic imports with a few extra features","repository":{"type":"git","url":"git+https://github.com/75lb/load-module.git"},"type":"module","exports":"./index.js","keywords":["load","require","module","package","import","esm"],"license":"MIT","engines":{"node":">=12.20"},"scripts":{"test":"test-runner test/*.js"},"devDependencies":{"current-module-paths":"^1.1.1","test-runner":"^0.11.0"},"dependencies":{"array-back":"^6.2.2"},"standard":{"ignore":["tmp"],"envs":[]},"_id":"load-module@5.0.0","gitHead":"7a8c12f4aa44cc02efa788b2df6d16298c15630e","bugs":{"url":"https://github.com/75lb/load-module/issues"},"homepage":"https://github.com/75lb/load-module#readme","_nodeVersion":"22.4.1","_npmVersion":"10.8.1","dist":{"integrity":"sha512-zZBnYIvAuP2TprnRisam+N/A3v+JX60pvdKoHQRKyl4xlHLQQLpp7JKNyEQ6D3Si0/QIQMgXko3PtV+cx6L7mA==","shasum":"a2402683cd6d14049ed10fa75de681aab60dddb6","tarball":"http://registry-npm.ywwl.com/load-module/download/load-module-5.0.0.tgz","fileCount":4,"unpackedSize":7777,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIESTg9WAb/83PmqgSFXYbgl4Aaqb9qggJB048JOxm3YVAiAtEQmB+S8iRtNWVBn4z8t0OFmzIqKJqeZjae2WX7mjLA=="}],"size":2768,"noattachment":false,"key":"/load-module/-/load-module-5.0.0.tgz"},"_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/load-module_5.0.0_1721415243356_0.39513049041792314"},"_hasShrinkwrap":false,"readme":"[![view on npm](https://badgen.net/npm/v/load-module)](https://www.npmjs.org/package/load-module)\n[![npm module downloads](https://badgen.net/npm/dt/load-module)](https://www.npmjs.org/package/load-module)\n[![Gihub repo dependents](https://badgen.net/github/dependents-repo/75lb/load-module)](https://github.com/75lb/load-module/network/dependents?dependent_type=REPOSITORY)\n[![Gihub package dependents](https://badgen.net/github/dependents-pkg/75lb/load-module)](https://github.com/75lb/load-module/network/dependents?dependent_type=PACKAGE)\n[![Node.js CI](https://github.com/75lb/load-module/actions/workflows/node.js.yml/badge.svg)](https://github.com/75lb/load-module/actions/workflows/node.js.yml)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)\n\n# load-module\n\nStandard [dynamic imports](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#dynamic_imports) intended for runtime loading of user-defined modules (e.g. plugins).\n\n- Search for modules in one or more specific folders.\n- Specify a base folder from which to resolve from (e.g. the current working directory).\n\n## Synopsis\n\n```js\nimport { loadModule } from 'load-module'\n\nconst ViewClass = await loadModule('default-view', { paths: '~/my-view-folder'})\nconst view = new ViewClass()\n```\n\n## load-module\n\n* [load-module](#module_load-module)\n    * [loadModule(specifier, options)](#module_load-module.loadModule)\n    * [loadModuleSpecifier(specifier)](#module_load-module.loadModuleSpecifier)\n    * [loadModuleResolvedFrom(specifier, paths)](#module_load-module.loadModuleResolvedFrom)\n    * [loadModuleRelativeTo(specifier, paths)](#module_load-module.loadModuleRelativeTo)\n\n### <a name=\"module_load-module.loadModule\">loadModule(specifier, options)</a>\n\n**Kind**: exported function\n\n| Param | Type | Description |\n| ---   | ---  | --- |\n| specifier | `string` | A valid Node.js module specifier. |\n| options.paths | `string[]` | One or more directories to pass to both `loadModuleResolvedFrom` and `loadModuleRelativeTo`. |\n| options.resolvedFromPaths | `string[]` | Specific directories to pass to `loadModuleResolvedFrom`. |\n| options.relativeToPaths | `string[]` | Specific directories to pass to `loadModuleRelativeTo`. |\n\n<a name=\"module_load-module.loadModuleSpecifier\"></a>\n\n### loadModuleSpecifier(specifier)\n\n**Kind**: exported function\n\n| Param | Type | Description |\n| --- | --- | --- |\n| specifier | `string` | A valid Node.js module specifier. |\n\n<a name=\"module_load-module.loadModuleResolvedFrom\"></a>\n\n### loadModuleResolvedFrom(specifier, paths)\n\n**Kind**: exported function\n\n| Param | Type | Description |\n| --- | --- | --- |\n| specifier | `string` | A valid Node.js module specifier. |\n| paths | `string` \\| `Array.<string>` | One or more additional directories from which to resolve the supplied specifier from. |\n\n<a name=\"module_load-module.loadModuleRelativeTo\"></a>\n\n### loadModuleRelativeTo(specifier, paths)\n\n**Kind**: exported function\n\n| Param | Type | Description |\n| --- | --- | --- |\n| specifier | `string` | A valid module path. |\n| paths | `string` \\| `Array.<string>` | One or more additional directories in which to search for the supplied module path. |\n\n\n* * *\n\n&copy; 2017-24 Lloyd Brookes \\<75pound@gmail.com\\>.\n\nTested by [test-runner](https://github.com/test-runner-js/test-runner). Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).\n","publish_time":1721415243530,"maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"_cnpm_publish_time":1721415243530,"dist-tags":{"latest":"5.0.0","next":"4.0.0-2"}}