{"id":43394766,"url":"https://github.com/webkong/import-modules-auto","last_synced_at":"2026-02-02T14:21:26.946Z","repository":{"id":57272988,"uuid":"149770394","full_name":"webkong/import-modules-auto","owner":"webkong","description":null,"archived":false,"fork":false,"pushed_at":"2018-09-21T13:57:23.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T08:36:16.255Z","etag":null,"topics":["commonjs","dictionary","export","import","modules","require"],"latest_commit_sha":null,"homepage":null,"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/webkong.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}},"created_at":"2018-09-21T13:53:48.000Z","updated_at":"2018-09-21T14:01:08.000Z","dependencies_parsed_at":"2022-09-01T00:21:26.993Z","dependency_job_id":null,"html_url":"https://github.com/webkong/import-modules-auto","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/webkong/import-modules-auto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webkong%2Fimport-modules-auto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webkong%2Fimport-modules-auto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webkong%2Fimport-modules-auto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webkong%2Fimport-modules-auto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webkong","download_url":"https://codeload.github.com/webkong/import-modules-auto/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webkong%2Fimport-modules-auto/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29012819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T12:48:30.580Z","status":"ssl_error","status_checked_at":"2026-02-02T12:46:38.384Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["commonjs","dictionary","export","import","modules","require"],"created_at":"2026-02-02T14:21:26.056Z","updated_at":"2026-02-02T14:21:26.941Z","avatar_url":"https://github.com/webkong.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# import-modules-auto [![Build Status](https://travis-ci.org/sindresorhus/import-modules-auto.svg?branch=master)](https://travis-ci.org/sindresorhus/import-modules-auto)\n\nFork from [https://github.com/sindresorhus/import-modules](https://github.com/sindresorhus/import-modules)\n\nAdd when import Object-Module, merge Object without key-word.\n\n\u003e Import all modules in a directory smart\n\n*This module is intentionally simple. Not interested in more features.*\n\n\n## Install\n\n```\n$ npm install --save import-modules-auto\n```\n\n\n## Usage\n\n```\n.\n└── dir\n    ├── foo-bar.js  //function\n    └── baz-faz.js  //object {test: 'value'}\n```\n\n```js\nconst importModules = require('import-modules-auto');\nconst modules = importModules('dir');\n\nconsole.log(modules);\n//=\u003e {fooBar: [Function], bazFaz: [Function]}\n```\n```js\nconst importModules = require('import-modules-auto');\nconst modules = importModules('dir',{hasKey: false});\n\nconsole.log(modules);\n//=\u003e {fooBar: [Function], test: 'value'}\n```\n\n## API\n\n### importModules([directory], [options])\n\n#### directory\n\nType: `string`\u003cbr\u003e\nDefault: `__dirname`\n\nDirectory to import modules from. Unless you've modified [`require.extensions`](https://nodejs.org/api/globals.html#globals_require_extensions), that means any `.js`, `.json`, `.node` files, in that order. Does not recurse. Ignores the caller file and files starting with `.` or `_`.\n\n#### options\n\nType: `Object`\n\n##### camelize\n\nType: `boolean`\u003cbr\u003e\nDefault: `true`\n\nConvert dash-style names (`foo-bar`) to camel-case (`fooBar`).\n##### haskey\n\nType: `boolean`\u003cbr\u003e\nDefault: `true`\n\nCan set module without key words, merge object.\n\n## Related\n\n- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path\n- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory\n- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import a module lazily\n\n\n## License\n\nMIT © [webkong](https://blog.webkong.cn)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebkong%2Fimport-modules-auto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebkong%2Fimport-modules-auto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebkong%2Fimport-modules-auto/lists"}