{"name":"require-dir","description":"Helper to require() directories.","version":"1.1.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":"608ebe593ead957972356d4c91b0a228544072a3","bugs":{"url":"https://github.com/aseemk/requireDir/issues"},"_id":"require-dir@1.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.6.0","_npmUser":{"name":"contra","email":"yo@contra.io"},"dist":{"integrity":"sha512-XwZR1Gdv8rme0xLSRmxWNue/xQ5mgIfFGwbBJaF7TbFqQBgEBTr/M1/73a4dfn/keF5WDDiUr6RAF4nA1LskrQ==","shasum":"1ce24f41b57bcc31210fe0a9c4ede85b28cfa907","tarball":"http://registry-npm.ywwl.com/require-dir/download/require-dir-1.1.0.tgz","fileCount":39,"unpackedSize":16488,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbrnI4CRA9TVsSAnZWagAA6X4P+gJwBS2+MK1bwTYKvnc5\nd4WI3+herqV8W0MLM9orb6Ks4I/os7wgdYVClrFPyd+tveVl/s/l3mjEA4/G\ny0Byv2EJ3LVsUBfadWEB9MeQP6lEganfLBayrbMJETAQWaUO0SAC5YKSJZr0\nW7tdx3as3Pv22+YGU2Oo8RtUD+n9/y1yfLr6D+tBQjpMjz2RGhz6MWQtTLwH\nDFDP4xXtY/xCcLYKBfMIttR3iSEg35mDYbmxQaxpiKt2R4hZ9h8s0troIPbS\nOSvu4R8yUeI5YxiHXeKFV5ObGp/vHp+XBPF4UGxApImMPd9ad4NGbqM3vx8l\nQS/h3OBurcmEirZHlkq6hPuQK5yRbuhUH/HNw8KIVVRk6FlS8jEtA6rFlq7v\n4K2ARczQ36DY+wmPAG4qZjl3gs2Nqedwt+eCWSsv3eD39dGuEwbSVmAsn5Sc\n/KcWYBMfJxW75oy7u6dDgVIdIHTax4n0ukZbcrUAjGHfUpUaf8i9/D4nvhNP\nj3NEA05vRMDXauAwqFBohVf7waNHVGx0gDE+m909OdMmOW/yYlgUi8GWe+RG\nVnp4QVrwyp3WWmAzqHT46UgtiElA42W8sGb8YHBQ/P/XqNm8LPeNCpc92KWO\nUqAbHPG+VmOZ/mFYUZhaFhOJpz/TBvorpAwnsdG+qGfD6ufbTL93v+k2tSxj\nnZPi\r\n=4iLD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDqaGPWnsL0Ph4zdgY62socDdwk3kPz9482z9qlaQmyfAiARC3tcZ2VBwRBAgfiuK9iY0dKC+YcMedq2KeHvUmT2+g=="}],"size":6379,"noattachment":false,"key":"/require-dir/-/require-dir-1.1.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.1.0_1538159159668_0.9660845926655968"},"_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":1538159159829,"_cnpm_publish_time":1538159159829,"dist-tags":{"latest":"1.2.0"}}