{"name":"require-dir","description":"Helper to require() directories.","version":"1.2.0","author":{"name":"Aseem Kishore","email":"aseem.kishore@gmail.com"},"license":"MIT","dependencies":{},"devDependencies":{"coffee-script":"^1.3.3","ts-node":"^1.3.0","typescript":"^1.8.0"},"engines":{"node":"*"},"scripts":{"test":"node test"},"homepage":"https://github.com/aseemk/requireDir","repository":{"type":"git","url":"git://github.com/aseemk/requireDir.git"},"gitHead":"21600ade210ad00ba144658188c588e06e53d7c6","bugs":{"url":"https://github.com/aseemk/requireDir/issues"},"_id":"require-dir@1.2.0","_npmVersion":"6.4.1","_nodeVersion":"10.6.0","_npmUser":{"name":"contra","email":"yo@contra.io"},"dist":{"integrity":"sha512-LY85DTSu+heYgDqq/mK+7zFHWkttVNRXC9NKcKGyuGLdlsfbjEPrIEYdCVrx6hqnJb+xSu3Lzaoo8VnmOhhjNA==","shasum":"0d443b75e96012d3ca749cf19f529a789ae74817","tarball":"http://registry-npm.ywwl.com/require-dir/download/require-dir-1.2.0.tgz","fileCount":40,"unpackedSize":17273,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh25uQCRA9TVsSAnZWagAADhQP/R3smVkc6/cqNTNxbjNB\n1kA83JbCE2SYAFvzA1Lbg5LTvACLnw3gzgwtJCcl/cBJti6kwyjFEUhKNnzJ\ngE5eX2oLbfOVORjWOP8f535QCotjv24J7sZwfmUE5ubq9tn4IZzpXL4aUr4r\nmZ5WWsBtzvgXqUjQrqGAHV4xXij3BEe1ObyNDD7HwfnuOwL9EGkYYLvycWfc\nHWfHuYWjWAyJ2MukM5RvRuWhPhh6H/qCfrYBBfg/S12FlxgN1KGRX+IZhZqX\nNt65LMMSZUjFJYaA8E5hglY2cbFw/aKqSU5Rc8iZq0g3/9Qrct88rSog1eeR\neTWESYKxCSgh+2/FWjIlKR6Ql+DfXA/7r77kSaui9OHuF4myUSrRo5fUyTez\nxbL7PO7mE4zjGtvzGdjpb1JRe4O1c2GUMu5YMvpERBtl/t4vma/kBs3GK/kB\nbx1vOfUDfps4+02e67/XXN+uU3sdgtTB7/qmdZoqgH3qYAUth/Bdtuwk4AOr\n4BNKVzR4n4y+NLuzLrP9aB6eVXBPtUENJl0pEYYyOZJ7aqDxogXnqtUhKXoT\nZOPYG2YhL6R3FWAnMLp6I11Ik19LqaxPB/CWcNtv33OvGrcNMBKj4qYu8vJ4\nOgiCgATphPklO4JR5vrkmbWOLJbWlX6JIxuW49jFa/vdpO+mABDU1wrYV9Gy\nM4CV\r\n=knLg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjYo7bXc0S9oNgGgSN8hd35gkXYnpwkZUYmVIMdjyiagIgUo1UAdAdRR5GZFUHZQTi4R+3Z4KCcjfljZXJQsrbx2M="}],"size":6504,"noattachment":false,"key":"/require-dir/-/require-dir-1.2.0.tgz"},"maintainers":[{"email":"aseem.kishore@gmail.com","name":"aseemk"},{"email":"yo@contra.io","name":"contra"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/require-dir_1.2.0_1543251366001_0.9675137317684517"},"_hasShrinkwrap":false,"readme":"[![Build Status](https://travis-ci.org/aseemk/requireDir.svg?branch=master)](https://travis-ci.org/aseemk/requireDir)\n[![npm version](https://badge.fury.io/js/require-dir.svg)](http://badge.fury.io/js/require-dir)\n\n# requireDir()\n\nNode helper to `require()` directories. The directory's files are examined,\nand each one that can be `require()`'d is `require()`'d and returned as part\nof a hash from that file's basename to its exported contents.\n\n## Example\n\nGiven this directory structure:\n\n```\ndir\n+ a.js\n+ b.json\n+ c.coffee\n+ d.txt\n```\n\n`requireDir('./dir')` will return the equivalent of:\n\n```js\n{\n  a: require('./dir/a.js'),\n  b: require('./dir/b.json')\n}\n```\n\nIf CoffeeScript is registered via `require('coffee-script/register')`,\n`c.coffee` will also be returned. Any extension registered with node will work the same way without any additional configuration.\n\n## Installation\n\n```\nnpm install require-dir\n```\n\nNote that this package is *not* `requireDir` — turns out that's already\n[taken](https://github.com/JamesEggers1/node-requiredir)! ;)\n\n## Usage\n\nBasic usage that examines only directories' immediate files:\n\n```js\nvar requireDir = require('require-dir');\nvar dir = requireDir('./path/to/dir');\n```\n\nYou can optionally customize the behavior by passing an extra options object:\n\n```js\nvar dir = requireDir('./path/to/dir', { recurse: true });\n```\n\n## Options\n\n`recurse`: Whether to recursively `require()` subdirectories too.\n(`node_modules` within subdirectories will be ignored.)\nDefault is false.\n\n`filter`: Apply a filter on the filename before require-ing. For example, ignoring files prefixed with `dev` in a production environment:\n\n```js\nrequireDir('./dir', {\n  filter: function (fullPath) {\n    return process.env.NODE_ENV !== 'production' && !fullPath.match(/$dev/);\n  }\n})\n```\n\n`mapKey`: Apply a transform to the module base name after require-ing. For example, uppercasing any module names:\n\n```js\nrequireDir('./dir', {\n  mapKey: function (value, baseName) {\n    return baseName.toUpperCase();\n  }\n})\n```\n\n`mapValue`: Apply a transform to the value after require-ing. For example, uppercasing any text exported:\n\n```js\nrequireDir('./dir', {\n  mapValue: function (value, baseName) {\n    return typeof value === 'string' ? value.toUpperCase() : value;\n  }\n})\n```\n\n`duplicates`: By default, if multiple files share the same basename, only the\nhighest priority one is `require()`'d and returned. (Priority is determined by\nthe order of `require.extensions` keys, with directories taking precedence\nover files if `recurse` is true.) Specifying this option `require()`'s all\nfiles and returns full filename keys in addition to basename keys.\nDefault is false.\n\nIn the example above, if there were also an `a.json`, the behavior would\nbe the same by default, but specifying `duplicates: true` would yield:\n\n```js\n{\n  a: require('./dir/a.js'),\n  'a.js': require('./dir/a.js'),\n  'a.json': require('./dir/a.json'),\n  b: require('./dir/b.json'),\n  'b.json': require('./dir/b.json')\n}\n```\n\n`noCache`: Prevent file caching. Could be useful using gulp.watch or other watch requiring refreshed file content Default is false.\n\n```js\nrequireDir('./dir', { noCache: true })\n```\n\n`extensions`: Array of extensions to look for instead of using `require.extensions`.\n\n```js\nrequireDir('./dir', { extensions: ['.js', '.json'] })\n```\n\n## Tips\n\nMake an `index.js` in a directory with this code to clean things up:\n\n```js\nmodule.exports = require('require-dir')();   // defaults to '.'\n```\n\nAnd don't worry, the calling file is always ignored to prevent infinite loops.\n","publish_time":1543251366158,"_cnpm_publish_time":1543251366158,"dist-tags":{"latest":"1.2.0"}}