{"id":16644184,"url":"https://github.com/75lb/load-module","last_synced_at":"2025-07-30T03:04:13.711Z","repository":{"id":60775081,"uuid":"93270689","full_name":"75lb/load-module","owner":"75lb","description":"Node's require with a few extra features","archived":false,"fork":false,"pushed_at":"2024-07-19T18:53:43.000Z","size":667,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-19T00:42:04.689Z","etag":null,"topics":["import","javascript","load","module","nodejs","require"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/75lb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-03T19:51:20.000Z","updated_at":"2025-04-14T13:47:50.000Z","dependencies_parsed_at":"2024-10-12T08:10:45.309Z","dependency_job_id":null,"html_url":"https://github.com/75lb/load-module","commit_stats":{"total_commits":74,"total_committers":1,"mean_commits":74.0,"dds":0.0,"last_synced_commit":"a413d2a04c86f8c78e8711c058e5582ed9157d2e"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/75lb/load-module","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fload-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fload-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fload-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fload-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/75lb","download_url":"https://codeload.github.com/75lb/load-module/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fload-module/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267744313,"owners_count":24137788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["import","javascript","load","module","nodejs","require"],"created_at":"2024-10-12T08:10:43.464Z","updated_at":"2025-07-30T03:04:13.631Z","avatar_url":"https://github.com/75lb.png","language":"JavaScript","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### \u003ca name=\"module_load-module.loadModule\"\u003eloadModule(specifier, options)\u003c/a\u003e\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\u003ca name=\"module_load-module.loadModuleSpecifier\"\u003e\u003c/a\u003e\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\u003ca name=\"module_load-module.loadModuleResolvedFrom\"\u003e\u003c/a\u003e\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.\u003cstring\u003e` | One or more additional directories from which to resolve the supplied specifier from. |\n\n\u003ca name=\"module_load-module.loadModuleRelativeTo\"\u003e\u003c/a\u003e\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.\u003cstring\u003e` | One or more additional directories in which to search for the supplied module path. |\n\n\n* * *\n\n\u0026copy; 2017-24 Lloyd Brookes \\\u003c75pound@gmail.com\\\u003e.\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","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F75lb%2Fload-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F75lb%2Fload-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F75lb%2Fload-module/lists"}