{"name":"vfile-find-down","version":"1.0.0","description":"Find one or more files by searching the file system downwards","license":"MIT","keywords":["vfile","walk","find","down","downward","downwards","above","retext","mdast"],"repository":{"type":"git","url":"git+https://github.com/wooorm/vfile-find-down.git"},"dependencies":{"to-vfile":"^1.0.0"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com"},"files":["index.js"],"devDependencies":{"eslint":"^1.0.0","esmangle":"^1.0.0","istanbul":"^0.4.0","jscs":"^2.0.0","jscs-jsdoc":"^1.0.0","mdast":"^2.0.0","mdast-comment-config":"^1.0.0","mdast-github":"^1.0.0","mdast-lint":"^1.0.0","mdast-slug":"^2.0.0","mdast-validate-links":"^1.1.1","tape":"^4.2.0"},"scripts":{"build-md":"mdast . --quiet  --frail","build":"npm run build-md","lint-api":"eslint .","lint-style":"jscs --reporter inline .","lint":"npm run lint-api && npm run lint-style","test-api":"node test/index.js","test-coverage":"istanbul cover test/index.js","test":"npm run build && npm run lint && npm run test-coverage"},"gitHead":"814dd210cff202661d3b7c1c0d15f209c2f4fe45","bugs":{"url":"https://github.com/wooorm/vfile-find-down/issues"},"homepage":"https://github.com/wooorm/vfile-find-down#readme","_id":"vfile-find-down@1.0.0","_shasum":"84a4d66d03513f6140a84e0776ef0848d4f0ad95","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"dist":{"shasum":"84a4d66d03513f6140a84e0776ef0848d4f0ad95","tarball":"http://registry-npm.ywwl.com/vfile-find-down/download/vfile-find-down-1.0.0.tgz","integrity":"sha512-AOXiJrVKizToYfRosXd1p9Fq8b0u0qchvSwVF1/ue3JE7o7KuQ/UH24bNAPLDUG/RIM1DZ6zWtDsiLShcma4WA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWuHI+7MBBDO4BboIPs3vqzbSbfgoVSpLwALRQeUgQ8AIgeDP9x0G9ri77lh0T1KCpbDfWyAlrVylctjFPUw3IaG8="}],"size":4687,"noattachment":false,"key":"/vfile-find-down/-/vfile-find-down-1.0.0.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"directories":{},"readme":"# vfile-find-down\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Sponsors][sponsors-badge]][collective]\n[![Backers][backers-badge]][collective]\n[![Chat][chat-badge]][chat]\n\n[vfile][] utility to find files by searching the file system downwards.\n\n## Contents\n\n*   [What is this?](#what-is-this)\n*   [When should I use this?](#when-should-i-use-this)\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`findDown(test[, paths][, callback])`](#finddowntest-paths-callback)\n    *   [`findDownAll(test[, paths][, callback])`](#finddownalltest-paths-callback)\n    *   [`Assert`](#assert)\n    *   [`Callback`](#callback)\n    *   [`CallbackAll`](#callbackall)\n    *   [`Result`](#result)\n    *   [`Test`](#test)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis utility lets you find one or many files downwards.\n\n## When should I use this?\n\nYou can use this utility if you want to find files in, say, a folder.\nOne example is all markdown files.\nIf you instead want to find files upwards, such as config files, you can use\n[`vfile-find-up`][vfile-find-up].\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16), install with [npm][]:\n\n```sh\nnpm install vfile-find-down\n```\n\n## Use\n\n```js\nimport {findDown} from 'vfile-find-down'\n\nconsole.log(await findDown('.md'))\n```\n\nYields:\n\n```js\nVFile {\n  cwd: '/Users/tilde/Projects/oss/vfile-find-down',\n  data: {},\n  history: [ '/Users/tilde/Projects/oss/vfile-find-down/readme.md' ],\n  messages: []\n}\n```\n\n## API\n\nThis package exports the identifiers\n[`findDown`][api-find-down] and\n[`findDownAll`][api-find-down-all].\nThere is no default export.\n\n### `findDown(test[, paths][, callback])`\n\nFind the first file or folder downwards.\n\n> 👉 **Note**: files are not read (their `value` is not populated).\n> use [`to-vfile`][to-vfile] for that.\n\n###### Signatures\n\n*   `(test[, paths], callback) => undefined`\n*   `(test[, paths]) => Promise<VFile>`\n\n###### Parameters\n\n*   `test` ([`Test`][api-test])\n    — things to search for\n*   `paths` (`Array<URL | string> | URL | string`, default: `process.cwd()`)\n    — places to search from\n*   `callback` ([`Callback`][api-callback], optional)\n    — callback called when done\n\n###### Returns\n\nNothing when `callback` is given (`undefined`), otherwise a promise that\nresolves to a file ([`VFile`][vfile] or `undefined`).\n\n### `findDownAll(test[, paths][, callback])`\n\nFind files or folders downwards.\n\n> 👉 **Note**: files are not read (their `value` is not populated).\n> use [`to-vfile`][to-vfile] for that.\n\n###### Signatures\n\n*   `(test[, paths], callback) => undefined`\n*   `(test[, paths]) => Promise<Array<VFile>>`\n\n###### Parameters\n\n*   `test` ([`Test`][api-test])\n    — things to search for\n*   `paths` (`Array<URL | string> | URL | string`, default: `process.cwd()`)\n    — places to search from\n*   `callback` ([`CallbackAll`][api-callback-all], optional)\n    — callback called when done\n\n###### Returns\n\nNothing when `callback` is given (`undefined`), otherwise a promise that\nresolves to files ([`Array<VFile>`][vfile]).\n\n### `Assert`\n\nHandle a file (TypeScript type).\n\n###### Parameters\n\n*   `file` ([`VFile`][vfile])\n    — file to handle\n*   `stats` ([`Stats`][stats])\n    — stats from `fs.stat`\n\n###### Returns\n\nHow to handle this file ([`Result`][api-result], optional).\n\n### `Callback`\n\nCallback called when done finding one file (TypeScript type).\n\n###### Parameters\n\n*   `error` (`Error` or `undefined`)\n    — error; errors are currently never passed\n*   `file` ([`VFile`][vfile] or `undefined`)\n    — file\n\n###### Returns\n\nNothing (`undefined`).\n\n### `CallbackAll`\n\nCallback called when done (TypeScript type).\n\n###### Parameters\n\n*   `error` (`Error` or `undefined`)\n    — error; errors are currently never passed\n*   `files` ([`Array<VFile>`][vfile])\n    — files\n\n###### Returns\n\nNothing (`undefined`).\n\n### `Result`\n\nWhat to do when collecting a file or folder (TypeScript type).\n\n###### Fields\n\n*   `break` (`boolean`, default: `false`)\n    — stop searching after this file or folder\n*   `include` (`boolean`, default: `false`)\n    — include this file or folder\n*   `skip` (`boolean`, default: `false`)\n    — do not search inside this folder\n\n### `Test`\n\nThings to search for (TypeScript type).\n\nFor strings, the `basename` or `extname` of files must match them and\nhidden folders and `node_modules` will not be searched.\nFor arrays, any test in them must match.\n\n###### Type\n\n```ts\ntype Test = Array<Assert | string> | Assert | string\n```\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the additional types\n[`Assert`][api-assert],\n[`Callback`][api-callback],\n[`CallbackAll`][api-callback-all],\n[`Result`][api-result], and\n[`Test`][api-test].\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line, `vfile-find-down@^7`,\ncompatible with Node.js 16.\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`vfile/.github`][health] for ways to\nget started.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organization, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n<!-- Definitions -->\n\n[build-badge]: https://github.com/vfile/vfile-find-down/workflows/main/badge.svg\n\n[build]: https://github.com/vfile/vfile-find-down/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/vfile/vfile-find-down.svg\n\n[coverage]: https://codecov.io/github/vfile/vfile-find-down\n\n[downloads-badge]: https://img.shields.io/npm/dm/vfile-find-down.svg\n\n[downloads]: https://www.npmjs.com/package/vfile-find-down\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[collective]: https://opencollective.com/unified\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/vfile/vfile/discussions\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[typescript]: https://www.typescriptlang.org\n\n[contributing]: https://github.com/vfile/.github/blob/main/contributing.md\n\n[support]: https://github.com/vfile/.github/blob/main/support.md\n\n[health]: https://github.com/vfile/.github\n\n[coc]: https://github.com/vfile/.github/blob/main/code-of-conduct.md\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[vfile]: https://github.com/vfile/vfile\n\n[to-vfile]: https://github.com/vfile/to-vfile\n\n[vfile-find-up]: https://github.com/vfile/vfile-find-up\n\n[stats]: https://nodejs.org/api/fs.html#fs_class_fs_stats\n\n[api-find-down-all]: #finddownalltest-paths-callback\n\n[api-find-down]: #finddowntest-paths-callback\n\n[api-assert]: #assert\n\n[api-callback]: #callback\n\n[api-callback-all]: #callbackall\n\n[api-result]: #result\n\n[api-test]: #test\n","publish_time":1447887027173,"_cnpm_publish_time":1447887027173,"dist-tags":{"latest":"7.1.0"}}