{"name":"find","version":"0.2.7","description":"Find files or directories by name","url":"https://github.com/yuanchuan/find","author":{"name":"yuanchuan","email":"yuanchuan23@gmail.com","url":"http://yuanchuan.name"},"main":"./index.js","dependencies":{"traverse-chain":"~0.1.0"},"devDependencies":{"mocha":"^2.2.4","tmp":"^0.0.25"},"keywords":["find","findfile","search","files"],"license":"MIT","repository":{"type":"git","url":"git://github.com/yuanchuan/find.git"},"bugs":{"url":"https://github.com/yuanchuan/find/issues"},"homepage":"https://github.com/yuanchuan/find#readme","directories":{"test":"test"},"scripts":{"test":"mocha"},"gitHead":"2f3e0b73d1ac01127e7d5ba2ebda240f68847cd5","_id":"find@0.2.7","_shasum":"7afbd00f8f08c5b622f97cda6f714173d547bb3f","_from":".","_npmVersion":"3.8.6","_nodeVersion":"6.1.0","_npmUser":{"name":"yuanchuan","email":"yuanchuan23@gmail.com"},"dist":{"shasum":"7afbd00f8f08c5b622f97cda6f714173d547bb3f","tarball":"http://registry-npm.ywwl.com/find/download/find-0.2.7.tgz","integrity":"sha512-+QhLzsS+vyYsZqojEIGDwzp5KxkhHs1BJUt2CtI93bL27SKj7H6FnAjwVIvjQiEXKV2qmgCj9ikqegVUIrw7ZA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2iWjPajoeI5FjRUtxIwj3DKwjd9GCA31zNmhLyyYHMAIgLQ4vtcfh5fsnc+LiQB1ZFJ/gkkQcVj+CfmObRDOZGB0="}],"size":5144,"noattachment":false,"key":"/find/-/find-0.2.7.tgz"},"maintainers":[{"name":"yuanchuan","email":"yuanchuan23@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/find-0.2.7.tgz_1468464624004_0.2802063503768295"},"readme":"# find [![Status](https://travis-ci.org/yuanchuan/find.svg?branch=master)](https://travis-ci.org/yuanchuan/find \"See test builds\")\n\nFind files or directories by name.\n\n[![NPM](https://nodei.co/npm/find.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/find/)\n\n## Installation\n\n```bash\n$ npm install --save find\n```\n\n## Examples\n\nFind all files in current directory.\n\n```javascript\nvar find = require('find');\n\nfind.file(__dirname, function(files) {\n  console.log(files.length);\n})\n```\n\nFilter by regular expression.\n\n```javascript\nfind.file(/\\.js$/, __dirname, function(files) {\n  console.log(files.length);\n})\n```\n\n## Features\n  * Recursively search each sub-directories\n  * Asynchronously or synchronously\n  * Filtering by regular expression or string comparing\n\n## Changelog\n#### 0.3.0\n  * Added `.use()` method\n\n#### 0.2.0\n  * The first `pattern` option is now optional\n  * Will follow symbolic links\n\n\n## API\n\n#### .file([pattern,] root, callback)\n\n```javascript\nfind.file(__dirname, function(files) {\n  //\n})\n```\n\n#### .dir([pattern,] root, callback)\n```javascript\nfind.dir(__dirname, function(dirs) {\n  //\n})\n```\n\n\n#### .eachfile([pattern,] root, action)\n\n```javascript\nfind.eachfile(__dirname, function(file) {\n  //\n})\n```\n\n#### .eachdir([pattern,] root, action)\n\n```javascript\nfind.eachdir(__dirname, function(dir) {\n  //\n})\n```\n\n#### .fileSync([pattern,] root)\n```javascript\nvar files = find.fileSync(__dirname);\n```\n\n#### .dirSync([pattern,] root)\n```javascript\nvar dirs = find.dirSync(__dirname);\n```\n\n#### .error([callback])\n\nHandling errors in asynchronous interfaces\n\n```javascript\nfind\n  .file(__dirname, function(file) {\n    //\n  })\n  .error(function(err) {\n    if (err) {\n      //\n    }\n  })\n```\n\n#### .end([callback])\n\nDetect `end` in `find.eachfile` and `find.eachdir`\n\n```javascript\nfind\n  .eachfile(__dirname, function(file) {\n    //\n  })\n  .end(function() {\n    console.log('find end');\n  })\n```\n\n#### .use(Options)\n  * `fs`: The internal fs object to be used.\n\n```javascript\nconst { fs, vol } = require('memfs');\n\nconst json = {\n  './README.md': '1',\n  './src/index.js': '2'\n};\n\nvol.fromJSON(json, '/app');\n\nfind\n  .use({ fs: fs })\n  .file('/app', console.log);\n```\n","publish_time":1468464625923,"_cnpm_publish_time":1468464625923,"dist-tags":{"latest":"0.3.0"}}