{"_id":"@choojs/findup","_rev":"404080","name":"@choojs/findup","description":"Find a file by walking up the directory tree","dist-tags":{"latest":"0.2.1"},"maintainers":[{"name":"ahdinosaur","email":"michael.williams@enspiral.com"},{"name":"almost","email":"tom@almostobsolete.net"},{"name":"amongiants","email":"jon@folderstudio.com"},{"name":"benlyn","email":"bendik.lynghaug@gmail.com"},{"name":"bret","email":"bcomnes@gmail.com"},{"name":"colingourlay","email":"colin@colin-gourlay.com"},{"name":"emilbayes","email":"github@tixz.dk"},{"name":"feross","email":""},{"name":"freeman-lab","email":""},{"name":"goto-bus-stop","email":""},{"name":"graforlock","email":"neatcube@gmail.com"},{"name":"jameskyburz","email":"james.kyburz@gmail.com"},{"name":"juliangruber","email":"julian@juliangruber.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"mafintosh","email":""},{"name":"maxogden","email":""},{"name":"mreinstein","email":"reinstein.mike@gmail.com"},{"name":"s3ththompson","email":"s3th.thompson@gmail.com"},{"name":"sethvincent","email":"sethvincent@gmail.com"},{"name":"shama","email":""},{"name":"slaskis","email":"robert@publicclass.se"},{"name":"timwis","email":"tim@timwis.com"},{"name":"toddself","email":"todd@selfassembled.org"},{"name":"tornqvist","email":"calle.tornqvist@gmail.com"},{"name":"ungoldman","email":"ungoldman@gmail.com"},{"name":"yerkopalma","email":"yerko.palma@usach.cl"},{"name":"yoshuawuyts","email":"i@yoshuawuyts.com"}],"time":{"modified":"2021-08-04T04:42:42.000Z","created":"2018-04-11T11:57:31.690Z","0.2.1":"2018-06-01T08:32:14.533Z","0.2.0":"2018-04-11T11:57:31.690Z"},"users":{},"author":{"name":"Filirom1","email":"filirom1@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/choojs/findup.git"},"versions":{"0.2.1":{"name":"@choojs/findup","description":"Find a file by walking up the directory tree","version":"0.2.1","author":{"name":"Filirom1","email":"filirom1@gmail.com"},"bin":{"findup":"bin/findup.js"},"bugs":{"url":"https://github.com/choojs/findup/issues"},"dependencies":{"commander":"^2.15.1"},"devDependencies":{"chai":"^4.1.2","mocha":"^5.0.5"},"homepage":"https://github.com/choojs/findup","license":"MIT","main":"index.js","repository":{"type":"git","url":"git+https://github.com/choojs/findup.git"},"scripts":{"test":"mocha ./test/*.js"},"gitHead":"cbdcbdc8896a123ac83f41f82ae8d4ec2809a97e","_id":"@choojs/findup@0.2.1","_npmVersion":"6.1.0","_nodeVersion":"10.3.0","_npmUser":{"name":"goto-bus-stop","email":"rene@kooi.me"},"dist":{"shasum":"ac13c59ae7be6e1da64de0779a0a7f03d75615a3","size":3596,"noattachment":false,"key":"/@choojs/findup/-/@choojs/findup-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@choojs/findup/download/@choojs/findup-0.2.1.tgz"},"maintainers":[{"name":"ahdinosaur","email":"michael.williams@enspiral.com"},{"name":"almost","email":"tom@almostobsolete.net"},{"name":"amongiants","email":"jon@folderstudio.com"},{"name":"benlyn","email":"bendik.lynghaug@gmail.com"},{"name":"bret","email":"bcomnes@gmail.com"},{"name":"colingourlay","email":"colin@colin-gourlay.com"},{"name":"emilbayes","email":"github@tixz.dk"},{"name":"feross","email":""},{"name":"freeman-lab","email":""},{"name":"goto-bus-stop","email":""},{"name":"graforlock","email":"neatcube@gmail.com"},{"name":"jameskyburz","email":"james.kyburz@gmail.com"},{"name":"juliangruber","email":"julian@juliangruber.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"mafintosh","email":""},{"name":"maxogden","email":""},{"name":"mreinstein","email":"reinstein.mike@gmail.com"},{"name":"s3ththompson","email":"s3th.thompson@gmail.com"},{"name":"sethvincent","email":"sethvincent@gmail.com"},{"name":"shama","email":""},{"name":"slaskis","email":"robert@publicclass.se"},{"name":"timwis","email":"tim@timwis.com"},{"name":"toddself","email":"todd@selfassembled.org"},{"name":"tornqvist","email":"calle.tornqvist@gmail.com"},{"name":"ungoldman","email":"ungoldman@gmail.com"},{"name":"yerkopalma","email":"yerko.palma@usach.cl"},{"name":"yoshuawuyts","email":"i@yoshuawuyts.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/findup_0.2.1_1527841933362_0.8682408920673526"},"_hasShrinkwrap":false,"publish_time":1527841934533,"_cnpm_publish_time":1527841934533},"0.2.0":{"author":{"name":"Filirom1","email":"filirom1@gmail.com"},"name":"@choojs/findup","description":"Walk up ancester's dir up to root","version":"0.2.0","repository":{"type":"git","url":"git+https://github.com/choojs/findup.git"},"bin":{"findup":"bin/findup.js"},"scripts":{"test":"mocha ./test/*.js"},"dependencies":{"commander":"^2.15.1"},"devDependencies":{"chai":"^4.1.2","mocha":"^5.0.5"},"license":"MIT","gitHead":"e71b5723961d730017e96018d2ec9f7519f7a41f","bugs":{"url":"https://github.com/choojs/findup/issues"},"homepage":"https://github.com/choojs/findup#readme","_id":"@choojs/findup@0.2.0","_npmVersion":"5.8.0","_nodeVersion":"9.11.1","_npmUser":{"name":"goto-bus-stop","email":"rene@kooi.me"},"dist":{"shasum":"7103d625cf9001295d65c086faeffb11c8fabc9c","size":3546,"noattachment":false,"key":"/@choojs/findup/-/@choojs/findup-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@choojs/findup/download/@choojs/findup-0.2.0.tgz"},"maintainers":[{"name":"ahdinosaur","email":"michael.williams@enspiral.com"},{"name":"almost","email":"tom@almostobsolete.net"},{"name":"amongiants","email":"jon@folderstudio.com"},{"name":"benlyn","email":"bendik.lynghaug@gmail.com"},{"name":"bret","email":"bcomnes@gmail.com"},{"name":"colingourlay","email":"colin@colin-gourlay.com"},{"name":"emilbayes","email":"github@tixz.dk"},{"name":"feross","email":""},{"name":"freeman-lab","email":""},{"name":"goto-bus-stop","email":""},{"name":"graforlock","email":"neatcube@gmail.com"},{"name":"jameskyburz","email":"james.kyburz@gmail.com"},{"name":"juliangruber","email":"julian@juliangruber.com"},{"name":"lrlna","email":"shestak.irina@gmail.com"},{"name":"mafintosh","email":""},{"name":"maxogden","email":""},{"name":"mreinstein","email":"reinstein.mike@gmail.com"},{"name":"s3ththompson","email":"s3th.thompson@gmail.com"},{"name":"sethvincent","email":"sethvincent@gmail.com"},{"name":"shama","email":""},{"name":"slaskis","email":"robert@publicclass.se"},{"name":"timwis","email":"tim@timwis.com"},{"name":"toddself","email":"todd@selfassembled.org"},{"name":"tornqvist","email":"calle.tornqvist@gmail.com"},{"name":"ungoldman","email":"ungoldman@gmail.com"},{"name":"yerkopalma","email":"yerko.palma@usach.cl"},{"name":"yoshuawuyts","email":"i@yoshuawuyts.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/findup_0.2.0_1523447851600_0.5494045197613664"},"_hasShrinkwrap":false,"publish_time":1523447851690,"_cnpm_publish_time":1523447851690}},"readme":"[![build status](https://secure.travis-ci.org/choojs/findup.png)](http://travis-ci.org/choojs/findup)\n@choojs/findup\n=======\n\n> This is a fork of [Filirom1/findup](https://github.com/Filirom1/findup), pending [#16](https://github.com/Filirom1/findup/pull/16).\n\n### Install\n\n```sh\nnpm install -g @choojs/findup\n```\n\n### Usage\n\nFind up a file in ancestor's dir\n\n\n    .\n    ├── config.json\n    └── f\n        └── e\n            └── d\n                └── c\n                    ├── b\n                    │   └── a\n                    └── config.json\n\n### Options\n\n- `maxdepth`: (Number, default -1) How far to traverse before giving up. If maxdepth is `-1`, then there is no limit.\n\n#### Async\n\nfindup(dir, fileName, options, callback)\nfindup(dir, iterator, options, callback) with `iterator(dir, cb)` where cb only accept `true` or `false`\n\n```js\nvar findup = require('@choojs/findup');\n\n\nfindup(__dirname + '/f/e/d/c/b/a', 'config.json', function(err, dir){\n  // if(e) e === new Error('not found')\n  // dir === '/f/e/d/c'\n});\n```\n\nor\n\n```js\nfindup(__dirname + '/f/e/d/c/b/a', function(dir, cb){\n  require('path').exists(dir + '/config.json', cb);\n}, function(err, dir){\n  // if(e) e === new Error('not found')\n  // dir === '/f/e/d/c'\n});\n```\n\n#### EventEmitter\n\nfindup(dir, fileName, options)\n\n```js\nvar findup = require('@choojs/findup');\nvar fup = findup(__dirname + '/f/e/d/c/b/a', 'config.json');\n```\n\nfindup(dir, iterator, options) with `iterator(dir, cb)` where cb only accept `true` or `false`\n\n```js\nvar findup = require('@choojs/findup');\nvar fup = findup(__dirname + '/f/e/d/c/b/a', function(dir, cb){\n  require('path').exists(dir + '/config.json', cb);\n});\n```\n\nfindup return an EventEmitter. 3 events are emitted: `found`, `error`, `end`\n\n`found` event is emitted each time a file is found.\n\nYou can stop the traversing by calling `stop` manually.\n\n```js\nfup.on('found', function(dir){\n  // dir === '/f/e/d/c'\n  fup.stop();\n});\n```\n\n`error` event is emitted when error happens\n\n```js\nfup.on('error', function(e){\n  // if(e) e === new Error('not found')\n});\n```\n\n`end` event is emitted at the end of the traversing or after `stop()` is\ncalled.\n\n```js\nfup.on('end', function(){\n  // happy end\n});\n```\n\n#### Sync\n\nfindup(dir, fileName)\nfindup(dir, iteratorSync) with `iteratorSync` return `true` or `false`\n```js\nvar findup = require('@choojs/findup');\n\ntry{\n  var dir = findup.sync(__dirname + '/f/e/d/c/b/a', 'config.json'); // dir === '/f/e/d/c'\n}catch(e){\n  // if(e) e === new Error('not found')\n}\n```\n\n#### CLI\n```js\nnpm install -g @choojs/findup\n\n$ cd test/fixture/f/e/d/c/b/a/\n$ findup package.json\n/root/findup/package.json\n```\n\nUsage\n\n```\n$ findup -h\n\nUsage: findup [FILE]\n\n    --name, -n       The name of the file to found\n    --dir, -d        The directoy where we will start walking up    $PWD\n    --help, -h       show usage                                     false\n    --verbose, -v    print log                                      false\n```\n\n### LICENSE MIT\n\n### Read the tests :)\n","_attachments":{},"homepage":"https://github.com/choojs/findup","bugs":{"url":"https://github.com/choojs/findup/issues"},"license":"MIT"}