{"name":"find","version":"0.2.6","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":"2bda1dbc5a277ffb65d2f90c9f9452b9a54ca599","_id":"find@0.2.6","_shasum":"0d218b5d48c3424193f64cea59d389f8daa71d01","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"yuanchuan","email":"yuanchuan23@gmail.com"},"dist":{"shasum":"0d218b5d48c3424193f64cea59d389f8daa71d01","tarball":"http://registry-npm.ywwl.com/find/download/find-0.2.6.tgz","integrity":"sha512-oYi2FG0OeEst7abAUXgDWpsWBOr1pBJz/gowneNJdiuWS22P+jnXPdjPWqZ67NgQWKhjwnB7vY1YAhcDdDs5ag==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZFhUvuW+jGXBTtDfY14L0a7DtS6RJQxotZcpHL2UxogIgLv1Tf+ArpcMdxZesStwhWxwzHZ4G7EksHvZ7Gf2p6yw="}],"size":5124,"noattachment":false,"key":"/find/-/find-0.2.6.tgz"},"maintainers":[{"name":"yuanchuan","email":"yuanchuan23@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/find-0.2.6.tgz_1464839528595_0.3875790985766798"},"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":1464839530945,"_cnpm_publish_time":1464839530945,"dist-tags":{"latest":"0.3.0"}}