{"name":"import-modules","version":"3.2.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":"fc622bb003526da636f44dc0e581274568c61a26","bugs":{"url":"https://github.com/sindresorhus/import-files/issues"},"homepage":"https://github.com/sindresorhus/import-files#readme","_id":"import-modules@3.2.0","_nodeVersion":"14.21.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-rnImqdZ/8Sopu0IxVo0l5tN3msvVwz794uJLnn+Jb01+FaAHsKrqE78tmE7z9JRZRsefBtBC7h4yphU4RGXR7A==","shasum":"4acd64b303784b56acef82c348b9f1cdb9d9a95c","tarball":"http://registry-npm.ywwl.com/import-modules/download/import-modules-3.2.0.tgz","fileCount":5,"unpackedSize":5673,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDd6iDrOQ3p1qqICQ3eYZFPhiDNRQDlp7+GbowU+qcwlgIgLE4ZbN/QlB1Knw7VhVU+WBnfHN0EOHNm7ahjH0Kpo9I="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtMHnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpyPA//fIuzyY28Fi6vFIIdMvuygX9du0vVZWrB4GSDMYBk+q54YIik\r\nJfIZzY+ZiclQ3w7Vpcm5/cv0U5zjF8lS7Ja++hftd0Si/myG5B3e1L0J3rm7\r\njaDds9bMefMZ6ziTRSf/7AzZi+Sy9ccf51l9iWAWwwtUJP72HuhhlAa9uR8E\r\nFb2ta4QCdkefa7cQ9FI9TGAN3xWG9tcbTQRxy74IpqHcLHukV2bZqfnwHcQU\r\nRpFPlNXF1oCgZVBgBMwSgr2UENww/mosMJd7We5X7eN4PwjAfMcYDJRxp3gs\r\nZ6rDE65o/je4ljhIe1Ji9Pjmkkwl1ldQ5T/l4xIUjkx2LfbqSO6yaf/qKD8Y\r\nilh7pAS3eZ76Z57WVW2uomRkW1zUhVhJDV6L3V/autC2oIQVPWv71cpj3eqr\r\nX7k0JTK2BhrkrZqR4yqr4W3Nkh3fJCDSGC9eUQXuUfA1QWwjtq0hv3tb+09r\r\n3GwaH1DH/YMYmgZGYAX5N8cM+fdPshrgEwPiaM8sHIXWj9JJinBwRFlw1LoO\r\n8sjB135DuGCN1Z7cDKE+FV9RGE8IM8dLY6x0AgI8hMjeuM3Y63qv1WxSaXqq\r\nSiX727dB+538Uq+FX0KWgp4RpTmSINb6PqSTky8k8yNPBSaQQbuJKuIiY5T4\r\nq5F8eOUv8Me4NSwyUEh5PcXHGkT30jGkbrU=\r\n=odxw\r\n-----END PGP SIGNATURE-----\r\n","size":2520,"noattachment":false,"key":"/import-modules/-/import-modules-3.2.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.2.0_1672790503444_0.06333773746989868"},"_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":1672790503679,"_cnpm_publish_time":1672790503679,"dist-tags":{"latest":"3.2.0"}}