{"name":"rcfinder","version":"0.1.8","description":"Find a config file (like .jshintrc) by walking up from a specific directory.","main":"index.js","scripts":{"test":"mocha test/*.js"},"keywords":["find","rcfile","rc","search","defaults","config"],"author":{"name":"Spencer Alger"},"license":"MIT","devDependencies":{"mocha":"~1.17.1","expect.js":"~0.2.0"},"directories":{"test":"test"},"dependencies":{"lodash":"~2.4.1"},"repository":{"type":"git","url":"git://github.com/spenceralger/rcfinder.git"},"bugs":{"url":"https://github.com/spenceralger/rcfinder/issues"},"homepage":"https://github.com/spenceralger/rcfinder","_id":"rcfinder@0.1.8","_shasum":"5fa24066830cf6a665f9e3820cb3c67f0af4058e","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"spenceralger","email":"spencer@spenceralger.com"},"maintainers":[{"name":"spenceralger","email":"spencer@spenceralger.com"}],"dist":{"shasum":"5fa24066830cf6a665f9e3820cb3c67f0af4058e","tarball":"http://registry-npm.ywwl.com/rcfinder/download/rcfinder-0.1.8.tgz","integrity":"sha512-RzTxTvJwHMUbpAFDhZFVOGj54jX/NrqRbyrApW6LjSRlhVVvZpYWunGk7WO2R/AY+rJgZMPay48o7uRhydWuUQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCetzmoNB8ezGWH1CRpGfb8sJdFHy0y5nlHHg7FqlZCXgIhAIz4q5x/SZWfn4lqsnFj0WBpIq5WI6dRGTp2uMjVKA2K"}],"size":3940,"noattachment":false,"key":"/rcfinder/-/rcfinder-0.1.8.tgz"},"readme":"# rcfinder\n\n[![Travis CI](https://travis-ci.org/spalger/rcfinder.svg)](https://travis-ci.org/spalger/rcfinder)\n\n**This module provides the file lookup logic for the generally more useful [rcloader](https://www.npmjs.org/package/rcloader) package**.\n\nFind a config file (like .jshintrc) by walking up from a specific directory.\n\nCustom logic can be implemented for loading your config files, and calls to\nthe file system are cached so that you can find files relative to every file\nin a project without making a ton of unnecessary calls.\n\n## install\n```js\nnpm install rcfinder\n```\n\n## Use\nCreate an instance of the RcFinder class, passing it the name of your config file and an object specifying other options.\n\n```js\nvar RcFinder = require('rcfinder');\nvar rcFinder = new RcFinder('.jshintrc', {});\n```\n\nThen you can use the finder to look up the proper config file for a directory.\n```js\n// get the closet .jshintc file for this file\nvar config = rcFinder.find(__dirname);\n```\n\nIf you want to use async file system calls, just specify a callback to find.\n```js\nrcFinder.find(__dirname, function (err, config) {\n\n});\n```\n\n## Config\nWhen creating an instance of the RcFinder class, you can specify options to dictate how the class behaves.\n### config.loader\nA function to call that will load a given path. Once the path for a config file is determined, this will be called with that path as it's only argument and it should return a proper value.\n\nThe default loader is:\n```js\nfunction loader(path) {\n  return JSON.parse(fs.readFileSync(path));\n}\n```\n\nTo make your loader async, simply ask for second argument which will be set to a node-style callback. You can also ask for a simple async JSON loader by setting `loader:` equal to `'async'`.\n\nNOTE:  You must call `.find()` with a callback if your loader is async.\n","publish_time":1404774529603,"_cnpm_publish_time":1404774529603,"dist-tags":{"latest":"0.1.9"}}