{"name":"findit","version":"2.0.0","description":"walk a directory tree recursively with events","main":"index.js","devDependencies":{"tap":"~0.4.4","mkdirp":"~0.3.5"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"http://github.com/substack/node-findit.git"},"keywords":["find","walk","directory","recursive","tree","traversal"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","gitHead":"06ddeca91b618957ff5089efb5268c8b57d127c0","bugs":{"url":"https://github.com/substack/node-findit/issues"},"homepage":"https://github.com/substack/node-findit","_id":"findit@2.0.0","_shasum":"6509f0126af4c178551cfa99394e032e13a4d56e","_from":".","_npmVersion":"1.4.15","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}],"dist":{"shasum":"6509f0126af4c178551cfa99394e032e13a4d56e","tarball":"http://registry-npm.ywwl.com/findit/download/findit-2.0.0.tgz","integrity":"sha512-ENZS237/Hr8bjczn5eKuBohLgaD0JyUd0arxretR1f9RO46vZHA1b2y0VorgGV3WaOT3c+78P8h7v4JGJ1i/rg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBbPTdZnsF4IWMfVdbNZSnsZjQkMegMVT2wmoKScgw6UAiEAweJvi3KlCkgX4gvO7fiWR9j4+0mp4tT/s6GK6SjJeCU="}],"size":4165,"noattachment":false,"key":"/findit/-/findit-2.0.0.tgz"},"directories":{},"readme":"# findit\n\nRecursively walk directory trees. Think `/usr/bin/find`.\n\n[![build status](https://secure.travis-ci.org/substack/node-findit.png)](http://travis-ci.org/substack/node-findit)\n\n# example\n\n``` js\nvar finder = require('findit')(process.argv[2] || '.');\nvar path = require('path');\n\nfinder.on('directory', function (dir, stat, stop) {\n    var base = path.basename(dir);\n    if (base === '.git' || base === 'node_modules') stop()\n    else console.log(dir + '/')\n});\n\nfinder.on('file', function (file, stat) {\n    console.log(file);\n});\n\nfinder.on('link', function (link, stat) {\n    console.log(link);\n});\n```\n\n# methods\n\n``` js\nvar find = require('findit')\n```\n\n## var finder = find(basedir, opts)\n\nReturn an event emitter `finder` that performs a recursive walk starting at\n`basedir`.\n\nIf you set `opts.followSymlinks`, symlinks will be followed. Otherwise, a\n`'link'` event will fire but symlinked directories will not be walked.\n\nIf `basedir` is actually a non-directory regular file, findit emits a single\n\"file\" event for it then emits \"end\".\n\nYou can optionally specify a custom\n[fs](http://nodejs.org/docs/latest/api/fs.html)\nimplementation with `opts.fs`. `opts.fs` should implement:\n\n* `opts.fs.readdir(dir, cb)`\n* `opts.fs.lstat(dir, cb)`\n* `opts.fs.readlink(dir, cb)` - optional if your stat objects from\n`opts.fs.lstat` never return true for `stat.isSymbolicLink()`\n\n## finder.stop()\n\nStop the traversal. A `\"stop\"` event will fire and then no more events will\nfire.\n\n# events\n\n## finder.on('path', function (file, stat) {})\n\nFor each file, directory, and symlink `file`, this event fires.\n\n## finder.on('file', function (file, stat) {})\n\nFor each file, this event fires.\n\n## finder.on('directory', function (dir, stat, stop) {})\n\nFor each directory, this event fires with the path `dir`.\n\nYour callback may call `stop()` on the first tick to tell findit to stop walking\nthe current directory.\n\n## finder.on('link', function (file, stat) {})\n\nFor each symlink, this event fires.\n\n## finder.on('readlink', function (src, dst) {})\n\nEvery time a symlink is read when `opts.followSymlinks` is on, this event fires.\n\n## finder.on('end', function () {})\n\nWhen the recursive walk is complete unless `finder.stop()` was called, this\nevent fires.\n\n## finder.on('stop', function () {})\n\nWhen `finder.stop()` is called, this event fires.\n\n## finder.on('error', function (err) {})\n\nWhenever there is an error, this event fires. You can choose to ignore errors or\nstop the traversal using `finder.stop()`.\n\nYou can always get the source of the error by checking `err.path`.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install findit\n```\n\n# license\n\nMIT\n","publish_time":1404195280882,"_cnpm_publish_time":1404195280882,"dist-tags":{"latest":"2.0.0"}}