{"name":"requireindex","description":"Write minimal node index.js files that require and export siblings by file basename","version":"1.2.0","license":"MIT","main":"index.js","repository":{"type":"git","url":"git://github.com/stephenhandley/requireindex.git"},"scripts":{"test":"node test/test.js"},"keywords":["require","index","index.js"],"directories":{"test":"test"},"bugs":{"url":"http://github.com/stephenhandley/requireindex/issues"},"engines":{"node":">=0.10.5"},"devDependencies":{"asserts":"4.0.x"},"author":{"name":"Stephen Handley","email":"stephen.handley@gmail.com","url":"http://person.sh"},"homepage":"https://github.com/stephenhandley/requireindex","gitHead":"150579152afc9488c6ff9b4378c3e2aee1b3a1c0","_id":"requireindex@1.2.0","_npmVersion":"5.6.0","_nodeVersion":"8.8.1","_npmUser":{"name":"stephenhandley","email":"stephen.handley@gmail.com"},"dist":{"integrity":"sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==","shasum":"3463cdb22ee151902635aa6c9535d4de9c2ef1ef","tarball":"http://registry-npm.ywwl.com/requireindex/download/requireindex-1.2.0.tgz","fileCount":18,"unpackedSize":6624,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4k+yx0ROmPwxX3hWrDySGe4qiGfUzgEKk83w84NSdzgIhAKwo4i4O0IVHBW4jhn4aqRxsfamebQR+zxZ4nea0ixTo"}],"size":2697,"noattachment":false,"key":"/requireindex/-/requireindex-1.2.0.tgz"},"maintainers":[{"name":"stephenhandley","email":"stephen.handley@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/requireindex_1.2.0_1518297172580_0.5402831530854062"},"_hasShrinkwrap":false,"readme":"# Description\n\nWrite minimal node index.js files that require and export siblings by file basename\n\n# Latest Version\n\n1.2.0\n\n# Installation\n```\nnpm install requireindex\n```\n\nor in package.json\n\n```json\n{\n  ...\n  \"dependencies\": {\n    \"requireindex\": \"1.1.x\"\n  }\n}\n```\n\n# Usage\nCheck the [test directory](https://github.com/stephenhandley/requireindex/tree/master/test) for example usage. The [test/lib](https://github.com/stephenhandley/requireindex/tree/master/test/lib) looks like:\n\n```\nlib/\n  index.js\n  Foo.js\n  bar/\n    index.js\n    f.js\n    fing.js\n    fed/\n      again.js\n      ignored.js\n      index.js\n      somemore.js\n  bam.js\n  _private.js\n\n```\n\nThe index.js files in [test/lib/](https://github.com/stephenhandley/requireindex/tree/master/test/lib/index.js) and [test/lib/bar/](https://github.com/stephenhandley/requireindex/tree/master/test/lib/bar/index.js) contain:\n\n```js\nmodule.exports = require('requireindex')(__dirname);\n```\n\nand the index.js file in [test/lib/bar/fed/](https://github.com/stephenhandley/requireindex/tree/master/test/lib/bar/fed/index.js) contains:\n\n```js\nmodule.exports = require('requireindex')(__dirname, ['again', 'somemore']);\n```\n\nThe optional second argument allows you to explicitly specify the required files using their basename. In this example [test/lib/bar/fed/ignored.js](https://github.com/stephenhandley/requireindex/tree/master/test/lib/bar/fed/ignored.js) is not included as a public module. The other way to make a module/file private without the need for explicitly naming all the other included files is to prefix the filename with an underscore, as demonstrated by [test/lib/_private.js](https://github.com/stephenhandley/requireindex/tree/master/test/lib/_private.js) which is not exported.\n\nSo, with these index.js files, the result of\n\n```js\nrequire('lib');\n```\n\nis:\n\n```js\n{\n  bam: {\n    m: [Function],\n    n: [Function]\n  },\n  bar: {\n    f: [Function],\n    fed: {\n      again: [Function],\n      somemore: [Function]\n    },\n    fing: [Function]\n  },\n  Foo: {\n    l: [Function],\n    ls: [Function]\n  }\n}\n```\n\n#Build status\n[![build status](https://secure.travis-ci.org/stephenhandley/requireindex.png)](http://travis-ci.org/stephenhandley/requireindex)\n","publish_time":1518297172631,"_cnpm_publish_time":1518297172631,"dist-tags":{"latest":"1.2.0"}}