{"name":"requireindex","description":"Write minimal node index.js files that require and export siblings by file basename","version":"1.0.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":{"lib":".","test":"test"},"bugs":{"url":"http://github.com/stephenhandley/requireindex/issues"},"engines":{"node":">=0.4.0"},"devDependencies":{"asserts":"~2.0.0"},"author":{"name":"Stephen Handley","email":"stephen.handley@gmail.com","url":"http://person.sh"},"_id":"requireindex@1.0.0","dist":{"shasum":"53342f4eeb2d2ea06e5f1e7c56ac55afcb4d4e07","tarball":"http://registry-npm.ywwl.com/requireindex/download/requireindex-1.0.0.tgz","integrity":"sha512-gxM5Izt+NTRN6UZKy/CaPm3KppGV6nlRE5XNp2lQEsKX8EEEyaSSk1gqUI2aMSJDMQZsYkr1z6f8i6aHHML5zQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlWb1BK5iY1Ul9HqeuoAGMA+2g8N+V6EoyDaYwz5CxagIhAMYTdBmdAPSnfPh7HlcG+xGUZm4RrhqPzQ3OKEwLcsbP"}],"size":2647,"noattachment":false,"key":"/requireindex/-/requireindex-1.0.0.tgz"},"_npmVersion":"1.1.59","_npmUser":{"name":"stephenhandley","email":"stephen.handley@gmail.com"},"maintainers":[{"name":"stephenhandley","email":"stephen.handley@gmail.com"}],"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":1348694036402,"_cnpm_publish_time":1348694036402,"dist-tags":{"latest":"1.2.0"}}