{"name":"requireindex","description":"Write minimal node index.js/index.coffee files that require and export all their siblings by file basename","version":"0.1.0","license":"MIT","repository":{"type":"git","url":"git://github.com/stephenhandley/requireindex.git"},"main":"index.js","keywords":["require","index","index.js"],"directories":{"lib":".","test":"test"},"bugs":{"url":"http://github.com/stephenhandley/requireindex/issues"},"engines":{"node":">=0.4.0"},"author":{"name":"Stephen Handley","email":"stephen.handley@gmail.com","url":"http://person.sh"},"_npmUser":{"name":"stephenhandley","email":"stephen.handley@gmail.com"},"_id":"requireindex@0.1.0","dependencies":{},"devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.2","_nodeVersion":"v0.6.15","_defaultsLoaded":true,"dist":{"shasum":"7782565e181b5382100e8677da00281a25e8b02c","tarball":"http://registry-npm.ywwl.com/requireindex/download/requireindex-0.1.0.tgz","integrity":"sha512-0IT5tlyCKH4wAezo/IW1NHqKG6R2daXzBMGaNAIRgdek8klkVVkGBPfJBQsPiJ5fi4InuqXN+Aqhw3UdwwVgug==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIESfP/jbwbhW6YBTXixzIFsuFoPB1GbU4EFEnQRiS0PMAiEAqkA32ncyP0WyvNHGJZQmm3AsZgIC4i0c7IIPCiLiEsw="}],"size":1888,"noattachment":false,"key":"/requireindex/-/requireindex-0.1.0.tgz"},"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":1336094432152,"_cnpm_publish_time":1336094432152,"dist-tags":{"latest":"1.2.0"}}