{"name":"import-modules","version":"3.1.0","description":"Import all modules in a directory","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/import-files.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["import","require","files","modules","all","directory","folder","js","paths","multiple","index"],"devDependencies":{"ava":"^2.4.0","tsd":"^0.19.1","xo":"^0.25.3"},"xo":{"ignores":["fixture"]},"types":"./index.d.ts","gitHead":"93e94e985c83a9d504a6571914c9fe9ff2489e99","bugs":{"url":"https://github.com/sindresorhus/import-files/issues"},"homepage":"https://github.com/sindresorhus/import-files#readme","_id":"import-modules@3.1.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.2","dist":{"integrity":"sha512-7upd0c06OiUviKhdWreF11adjjoAdWvjCBfd2Uo0HCjxba6V1tsBHkgwBOVJ8DaKY+OPpKFtUDVZN3gbRA4u0Q==","shasum":"b3940f9305c40b620098ed0a5287ea49336b1105","tarball":"http://registry-npm.ywwl.com/import-modules/download/import-modules-3.1.0.tgz","fileCount":5,"unpackedSize":5666,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMZG3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqeEQ/9GwPH/3P/Ia6pOfosqMs9ie40jPSPo1MNIqGxJ4IinzuaV3vT\r\nua09slAJT2/92OJSRs0ZWkgx3fjGD78UtUNmAEsdLZWmhFgG/n8uVjmx7abi\r\nOpEb3NGSrZPQyGNPBGW1ldVnRBDgHSJOj5cioQuBB6rE3iheWc5gQqZdS403\r\n7yBhv93DineBTnzzEMIKlF4MFbaPu7zJkcu/lVG6KiRXoLg0uhnw34ZzVdyI\r\n+Ci6yin4JkNr773oV7xACGjviJVjc2VhuyR9y+rQ9Vf3ML6Ji4lgWB6yS01X\r\ntFpk5IlQLuRIESQvH+a7YJVUgFlRecwEYHT0OhCo+uy+W+akRTd4mbb8H3Uo\r\nwiwhlQTyK9bsKoWrrXSd0PbJStVhi4KL32aw6fk9xr+3kn4esV2ZdlenF6N1\r\nS0eIaY30Os+I3G2hoEQMtwZnry3j2l9PUt4a4+84fXhrb8zeWTDzDdd1mivb\r\nX5cKvLd6Mk4LdMUCGUIxFQc+OO89DANH7lXxQ4DGF2cJMc9s9I+2EIGjZ0I9\r\niPkWoNSm5y+xP2FKsH1EMmLIygjrNIL2TDuBa2oTp5/sYvuQl+kmCbF8cw/n\r\ng8wrOjfGXYUJxX5XLh+hth/dAxsbTy6e79UlwScWxJWVjPlKL0EIcujO9JeP\r\n2zP4qjoLDDa9nPu2jMN2Wq9zAu2y/2Y9e2c=\r\n=9PIE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDOh9A2lQCivuddlqW/ef+l+Pw8YxSlg6bwDQ8b+vP/bQIhANSDiYai+bl90G7l5cdCBPtGGIChWboger8R1dqpXCA9"}],"size":2514,"noattachment":false,"key":"/import-modules/-/import-modules-3.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/import-modules_3.1.0_1647415735335_0.6614279848347715"},"_hasShrinkwrap":false,"readme":"# import-modules\n\n> Import all modules in a directory\n\n*This package is intentionally simple. Not interested in more features.*\n\n## Install\n\n```\n$ npm install import-modules\n```\n\n## Usage\n\n```\n.\n└── directory\n    ├── foo-bar.js\n    └── baz-faz.js\n```\n\n```js\nconst importModules = require('import-modules');\n\nconst modules = importModules('directory');\n\nconsole.log(modules);\n//=> {fooBar: [Function], bazFaz: [Function]}\n```\n\n## API\n\n### importModules(directory?, options?)\n\n#### directory\n\nType: `string`\\\nDefault: `__dirname`\n\nDirectory to import modules from. Unless you've set the `fileExtensions` option, 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`\\\nDefault: `true`\n\nConvert dash-style names (`foo-bar`) and snake-style names (`foo_bar`) to camel-case (`fooBar`).\n\n##### fileExtensions\n\nType: `string[]`\\\nDefault: `['.js', '.json', '.node']`\n\nFile extensions to look for. Order matters.\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","publish_time":1647415735510,"_cnpm_publish_time":1647415735510,"dist-tags":{"latest":"3.2.0"}}