{
  "name": "require-dir",
  "description": "Helper to require() directories.",
  "version": "0.1.0",
  "author": {
    "name": "Aseem Kishore",
    "email": "aseem.kishore@gmail.com"
  },
  "dependencies": {},
  "devDependencies": {
    "coffee-script": "~1.3.3"
  },
  "engines": {
    "node": "*"
  },
  "scripts": {
    "test": "node test"
  },
  "homepage": "https://github.com/aseemk/requireDir",
  "repository": {
    "type": "git",
    "url": "git://github.com/aseemk/requireDir.git"
  },
  "readme": "# 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{ a: require('./dir/a.js')\n, b: require('./dir/b.json')\n}\n```\n\nAnd if CoffeeScript was registered, `c.coffee` will also be returned.\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.\nDefault is false.\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\nE.g. in 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{ 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\nThere might be more options in the future. ;)\n\n## Tips\n\nIf you want to `require()` the same directory in multiple places, you can do\nthis in the directory itself! Just make an `index.js` file with the following:\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\n## TODO\n\nIt'd be awesome if this could work with the regular `require()`, e.g. like a\nregular `require()` hook. Not sure that's possible though; directories are\nalready special-cased to look for an `index` file or `package.json`.\n\nAn `ignore` option would be nice: a string or regex, or an array of either or\nboth, of paths, relative to the directory, to ignore. String paths can be\nextensionless to ignore all extensions for that path. Supporting shell-style\nglobs in string paths would be nice.\n\nCurrently, basenames are derived for directories too — e.g. a directory named\n`a.txt` will be returned as `a` when recursing — but should that be the case?\nMaybe directories should always be returned by their full name, and/or maybe\nthis behavior should be customizable. This is hopefully an edge case.\n\n## License\n\nMIT. &copy; 2012 Aseem Kishore.\n",
  "readmeFilename": "README.md",
  "bugs": {
    "url": "https://github.com/aseemk/requireDir/issues"
  },
  "_id": "require-dir@0.1.0",
  "_from": "require-dir@^0.1.0"
}
