{"id":19560675,"url":"https://github.com/zoubin/require-array","last_synced_at":"2026-06-04T23:31:17.904Z","repository":{"id":33646130,"uuid":"37298557","full_name":"zoubin/require-array","owner":"zoubin","description":"extend native require to handle array inputs based on node-resolve","archived":false,"fork":false,"pushed_at":"2015-06-18T03:27:20.000Z","size":140,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-19T23:22:25.043Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zoubin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-12T02:51:44.000Z","updated_at":"2015-06-12T09:47:55.000Z","dependencies_parsed_at":"2022-08-17T19:50:39.380Z","dependency_job_id":null,"html_url":"https://github.com/zoubin/require-array","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/zoubin/require-array","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Frequire-array","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Frequire-array/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Frequire-array/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Frequire-array/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoubin","download_url":"https://codeload.github.com/zoubin/require-array/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Frequire-array/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33924832,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-04T02:00:06.755Z","response_time":64,"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":[],"created_at":"2024-11-11T05:08:26.729Z","updated_at":"2026-06-04T23:31:17.873Z","avatar_url":"https://github.com/zoubin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# require-array\nextend native require to handle array inputs based on node-resolve\n\n## Example\n\n```\n⌘ tree example/\nexample/\n├── files\n│   ├── a.js\n│   ├── b.js\n│   └── exclude.js\n└── require.js\n```\n\nrequire.js:\n\n```javascript\n\nvar arequire = require('..');\n\nvar mods = arequire(['path', './a.js'], { basedir: __dirname + '/files' })\n\nconsole.log(\n    mods[0].basename('/path/to/a.js', '.js'),\n    mods[1]\n);\n\nmods = arequire.glob(['*.js', '!exclude.js'], { cwd: __dirname + '/files' })\n\nconsole.log(\n    mods\n);\n\n```\n\na.js:\n\n```javascript\nmodule.exports = 'a';\n```\n\nb.js:\n\n```javascript\nmodule.exports = 'b';\n```\n\nexclude.js:\n\n```javascript\nmodule.exports = 'exclude';\n```\n\n\noutput:\n\n```\n⌘ node example/require.js\na a\n[ 'a', 'b' ]\n```\n\n## Usage\n\n### arequire(mods, opts)\n\n* **mods**: *String* *Array* module names or paths to resolve by [node-resolve](https://www.npmjs.com/package/resolve)\n* **opts**: *Object|Function* *Optional* If *Object*, passed directly to [node-resolve.sync](https://github.com/substack/node-resolve#resolvesyncid-opts). If *Function*, used to resolve the modules like [node-resolve.sync](https://github.com/substack/node-resolve#resolvesyncid-opts)\n\n### arequire.resolve(mods, opts)\n\nResolve the path to be required.\n\n### arequire.glob(patterns, opts, resolveOpts)\n\n* **patterns**: *String* *Array* patterns to locate files by [xglob](https://www.npmjs.com/package/xglob)\n* **opts**: *Object* *Optional* passed directly to [xglob](https://www.npmjs.com/package/xglob)\n* **resolveOpts**: *Object|Function* *Optional* If *Object*, passed directly to [node-resolve.sync](https://github.com/substack/node-resolve#resolvesyncid-opts). If *Function*, used to resolve the modules like [node-resolve.sync](https://github.com/substack/node-resolve#resolvesyncid-opts)\n\n### arequire.glob.resolve(mods, opts, resolveOpts)\n\nResolve the path to be required.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Frequire-array","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoubin%2Frequire-array","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Frequire-array/lists"}