{"name":"import-modules","version":"3.0.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"},"keywords":["import","require","files","modules","all","directory","folder","js","paths","multiple","index"],"devDependencies":{"ava":"^2.4.0","xo":"^0.25.3"},"xo":{"ignores":["fixture"]},"gitHead":"c465830adba3f8b27e4d8deae65024c85d24266f","bugs":{"url":"https://github.com/sindresorhus/import-files/issues"},"homepage":"https://github.com/sindresorhus/import-files#readme","_id":"import-modules@3.0.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.2","dist":{"integrity":"sha512-Ngdnzcx6ZQ7sNrDiSfzPOr/55nCi82nNZAtqzFEtlD1+fDJueR1tQe4LYYz57UXxuUUqWBhLVZSClJRz0wJ9yA==","shasum":"0667da04e17e44fc5081feefc99b0e55f95dbeac","tarball":"http://registry-npm.ywwl.com/import-modules/download/import-modules-3.0.0.tgz","fileCount":4,"unpackedSize":4481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKcTYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpUng//YgKUG8n0cSlBUwzi/rd0wVpMgb/TALN/g0uvOYG0hSGhCGgh\r\n5qURHBdeVnwkEcYCsiUScwHd6LzZ+7n/IlMHeuNHDJ6/iXnRjgzpzBSxC2WD\r\n7bYUiIHksb/5kQjm8pJLsPfXdycOWpEwG5Plz/uBpaQ8dwDFkq4oZ9/KJTMl\r\nAmx6bOItA5mZelaPT1r0fJi3wlsCfPswbcspoluqfVqlvMB2+g3IecD5C4NY\r\nkIgt/otQ0bQutxbbpt0Xj507Gka12Go7D1epW4nvJqzC1YY10kSMAttj4wla\r\nQrZ8a5Nh0O8rse/B27472GwWaPKU7WVsIQ5o2MQ8At88Sl8xJb4ddhk/KYqf\r\nelPH9DfVOBaDZXSeUuxjncFgHKnOLjClfUK2CUyWIIVzoFUnxTvHNRHlydcV\r\n2hlpZ4JvKqzf/fPK5km/3L59Kgpbv8yAQ7wZk9RKjljZyan4ws+MzhWbvkU4\r\nLGVG6TkVKaIdsK8Q1UB38dXtd883V7XyDfayNOZZjN0Pf/3Q5QDWBTpMKYtD\r\nBHevUHtgfsK2qR62SD9HuQCaBf/ntLhiPEF06eHFpkO9Tw2o70FF2r3vqVfs\r\n1vCMfiA9r15zZ9YniJ2AbmWyWaQJ5ZhVwCllTweVWsK+LhWlw8MsyWqywXaI\r\nbFyrgn0vXwkHRrQ99onLXhA1IMHdYjRkENk=\r\n=vrlE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG4QpfzX+5mHci0xO0MNlMVR5T8k2wOEWHa4ySDQVqodAiAA60/pd5urlB8uEAT/Us77qydWUoIU7yZhiTjj5GiwLg=="}],"size":2263,"noattachment":false,"key":"/import-modules/-/import-modules-3.0.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.0.0_1646904536518_0.3645539106469762"},"_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":1646904536656,"_cnpm_publish_time":1646904536656,"dist-tags":{"latest":"3.2.0"}}