{"name":"rcfinder","version":"0.1.9","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":"^2.4.0","expect.js":"~0.2.0"},"directories":{"test":"test"},"dependencies":{"lodash.clonedeep":"^4.3.2"},"repository":{"type":"git","url":"git://github.com/spenceralger/rcfinder.git"},"bugs":{"url":"https://github.com/spenceralger/rcfinder/issues"},"homepage":"https://github.com/spenceralger/rcfinder","engines":{"node":">=0.10"},"gitHead":"a5c3d5825ea5e23eadd3a657936023529a01579d","_id":"rcfinder@0.1.9","_shasum":"f3e80f387ddf9ae80ae30a4100329642eae81115","_from":".","_npmVersion":"3.8.6","_nodeVersion":"6.0.0","_npmUser":{"name":"spalger","email":"email@spalger.com"},"dist":{"shasum":"f3e80f387ddf9ae80ae30a4100329642eae81115","tarball":"http://registry-npm.ywwl.com/rcfinder/download/rcfinder-0.1.9.tgz","integrity":"sha512-rhSo812VIVaX7cxl33KkllHRwfLvjZL3lQedWEpQ27YlMFKZbFZsiVdCcQn/Z0FauLWxIpKrNREGuHbJFSi0Lw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFoxihTiok3zgFejfyGO4JsafHlMDnqVZG5Z5SIw1jx/AiBHKPbrHVZQ3U7BG7owZArtSB0cUa0YTjcEualdgDTdNQ=="}],"size":3939,"noattachment":false,"key":"/rcfinder/-/rcfinder-0.1.9.tgz"},"maintainers":[{"name":"spalger","email":"email@spalger.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/rcfinder-0.1.9.tgz_1462823694853_0.652188234264031"},"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":1462823695267,"_cnpm_publish_time":1462823695267,"dist-tags":{"latest":"0.1.9"}}