{"_id":"closest-package","_rev":"373227","name":"closest-package","description":"Find the closest package.json file meeting specific criteria","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"time":{"modified":"2021-07-27T06:09:17.000Z","created":"2014-08-07T22:05:29.959Z","1.0.0":"2014-08-07T22:05:29.959Z"},"users":{"shriek":true},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughsk.io/"},"repository":{"type":"git","url":"git://github.com/hughsk/closest-package.git"},"versions":{"1.0.0":{"name":"closest-package","version":"1.0.0","description":"Find the closest package.json file meeting specific criteria","main":"index.js","license":"MIT","scripts":{"test":"node test | tap-spec"},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughsk.io/"},"dependencies":{},"devDependencies":{"deep-equal":"^0.2.1","tap-spec":"^0.2.0","tape":"^2.14.0"},"repository":{"type":"git","url":"git://github.com/hughsk/closest-package.git"},"keywords":["package","json","parse","find","up","closest"],"homepage":"https://github.com/hughsk/closest-package","bugs":{"url":"https://github.com/hughsk/closest-package/issues"},"gitHead":"6a9d9796e5d6a857e6897ca9f78085cdcbca30ef","_id":"closest-package@1.0.0","_shasum":"ef7a73ad90baae43a89db53777b20fcc0350d4cf","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"dist":{"shasum":"ef7a73ad90baae43a89db53777b20fcc0350d4cf","size":2243,"noattachment":false,"key":"/closest-package/-/closest-package-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/closest-package/download/closest-package-1.0.0.tgz"},"directories":{},"publish_time":1407449129959,"_cnpm_publish_time":1407449129959,"_hasShrinkwrap":false}},"readme":"# closest-package [![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)\n\nFind the closest package.json file meeting specific criteria by searching\nupwards from a given directory until hitting root.\n\n## Usage\n\n[![NPM](https://nodei.co/npm/closest-package.png)](https://nodei.co/npm/closest-package/)\n\n### `closest(dir, [filter], found(err, file))`\n\nGiven a starting directory `dir`, look up through every directory to see if\nit contains a `package.json` file matching the `filter` function, for example:\n\n``` javascript\nclosest(__dirname, function(json, filename) {\n  return json.name === 'async'\n}, function(err, file) {\n  console.log(file)\n})\n```\n\nNote that `filter` is optional and takes the following arguments:\n\n* `json`: the parsed `package.json` file.\n* `filename`: the `package.json`'s absolute filename.\n\n### `file = closest.sync(dir, [filter])`\n\nSame as the `closest` function, however executed synchronously:\n\n``` javascript\nvar result = closest.sync(__dirname, function(json, filename) {\n  return json.name === 'async'\n})\n\nconsole.log(result)\n```\n\n## License\n\nMIT. See [LICENSE.md](http://github.com/hughsk/closest-package/blob/master/LICENSE.md) for details.\n","_attachments":{},"homepage":"https://github.com/hughsk/closest-package","bugs":{"url":"https://github.com/hughsk/closest-package/issues"},"license":"MIT"}