{"name":"vfile-find-up","version":"6.0.0","description":"vfile utility to find one or more files by searching the file system upwards","license":"MIT","keywords":["vfile","vfile-util","util","utility","virtual","file","walk","find","up","upward"],"repository":{"type":"git","url":"git+https://github.com/vfile/vfile-find-up.git"},"bugs":{"url":"https://github.com/vfile/vfile-find-up/issues"},"funding":{"type":"opencollective","url":"https://opencollective.com/unified"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"index.d.ts","dependencies":{"to-vfile":"^7.0.0","vfile":"^5.0.0"},"devDependencies":{"@types/tape":"^4.0.0","c8":"^7.0.0","prettier":"^2.0.0","remark-cli":"^9.0.0","remark-preset-wooorm":"^8.0.0","rimraf":"^3.0.0","tape":"^5.0.0","type-coverage":"^2.0.0","typescript":"^4.0.0","xo":"^0.39.0"},"scripts":{"prepack":"npm run build && npm run format","build":"rimraf \"*.d.ts\" && tsc && type-coverage","format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node test/index.js","test-coverage":"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test/index.js","test":"npm run build && npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"rules":{"no-var":"off","prefer-arrow-callback":"off"}},"remarkConfig":{"plugins":["preset-wooorm"]},"typeCoverage":{"atLeast":100,"detail":true,"strict":true},"gitHead":"1e9d8cc5dbf9719d6511b48e68313f0434851bc7","homepage":"https://github.com/vfile/vfile-find-up#readme","_id":"vfile-find-up@6.0.0","_nodeVersion":"15.11.0","_npmVersion":"7.11.1","dist":{"integrity":"sha512-TPE1tYyHrYxewHxi42F8yP45rY5fK78jiPg9WP1xH5TfAbdncxja5NquZyYSSzG1aHpK98AvUOVJrEOoTonW6w==","shasum":"51a9ae3abd41bd739bc10f91922e3e26aee12508","tarball":"http://registry-npm.ywwl.com/vfile-find-up/download/vfile-find-up-6.0.0.tgz","fileCount":5,"unpackedSize":12746,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkrwYCRA9TVsSAnZWagAA27UQAIj+hqYNaBXNCCOxz4KC\n5o/DMkL2Zk6VCqbQPr/GXrvfIHQOplientkp8oEktfMVb90q+RnX0p6nKayu\nWdSCG+coJkIFBG5EFzMq0qfvxNEJSSjsPeWLXEo1KUQIvlumEZuM1E9zSnca\nwVi63ownaRbh9uYhuf8QAAIWWZTOY82om76q41IntLgG6Xiqb3hjVLIlL6vj\n2YxY4qwWx31c0dB7OjH07JeaMJECOjwFKFowAbguN4dcp7YYL87cCegNUjNZ\n6YcFNWnbA+TDM1TqhapvT6RhR7hdFlD8U30hBAqnTIGvfQpJXNZn1EyBE25G\nbiSIUKHOWDN/JMzu4bf6gfH0Z35uRAtBkuG8nxO/SA4/pbz5UFUdbBy+nJFR\n1czMqy+F3DBXgwGRhw14/NupED9Ruy8ybnqEgw3f3Il4XuqpxjGHjJuN4439\nzOM+hQZnL1TP9mVREFvUWxMXU60FF9CbpouSsuBj/Q5MljGay/1iPO/O+VtX\nwGfCcAohVZA28J8D+W8M4aCe2od85Fn7DWqJwOmFUUf5aRBy1jehkzBf6Dld\nhTERA/b4m8ZvakaTmN/ChZeM6w/mLEritREGymJtANI/GuzBviz4B2ulYw48\nrgJWV3cvO5U1E37OM1hLK2YavYNVCHeWtd+Nu6J8OzzCe9zZr1fVOq5NLQt1\nukhz\r\n=DeI1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEMV7Asq3+xksl8vpr0iHHY0SEclTLAopnet+Y685xZBAiBzyDi76Qf7L68YRUVi21DrAx0IAvsfBxrkVIfcjU4A3A=="}],"size":4573,"noattachment":false,"key":"/vfile-find-up/-/vfile-find-up-6.0.0.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vfile-find-up_6.0.0_1620229143920_0.39478074700389576"},"_hasShrinkwrap":false,"readme":"# vfile-find-up\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 upwards.\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    *   [`findUp(test[, path][, callback])`](#finduptest-path-callback)\n    *   [`findUpAll(test[, path][, callback])`](#findupalltest-path-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 upwards.\n\n## When should I use this?\n\nYou can use this utility if you want to find, say, a config file.\nIf you instead want to find files downwards, such as all markdown files in a\nfolder, you can use [`vfile-find-down`][vfile-find-down].\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-up\n```\n\n## Use\n\n```js\nimport {findUp} from 'vfile-find-up'\n\nconsole.log(await findUp('package.json'))\n```\n\nYields:\n\n```js\nVFile {\n  cwd: '/Users/tilde/Projects/oss/vfile-find-up',\n  data: {},\n  history: [ '/Users/tilde/Projects/oss/vfile-find-up/package.json' ],\n  messages: []\n}\n```\n\n## API\n\nThis package exports the identifiers [`findUp`][api-find-up] and\n[`findUpAll`][api-find-up-all].\nThere is no default export.\n\n### `findUp(test[, path][, callback])`\n\nFind the first file or folder upwards.\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[, path], callback) => undefined`\n*   `(test[, path]) => Promise<VFile>`\n\n###### Parameters\n\n*   `test` ([`Test`][api-test])\n    — things to search for\n*   `path` (`URL` or `string`, default: `process.cwd()`)\n    — place 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 | undefined`][vfile]).\n\n### `findUpAll(test[, path][, callback])`\n\nFind files or folders upwards.\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[, path], callback) => undefined`\n*   `(test[, path]) => Promise<Array<VFile>>`\n\n###### Parameters\n\n*   `test` ([`Test`][api-test])\n    — things to search for\n*   `paths` (`URL` or `string`, default: `process.cwd()`)\n    — place 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\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 | undefined`)\n    — error; errors are currently never passed\n*   `file` ([`VFile | undefined`][vfile])\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 | 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\n### `Test`\n\nThings to search for (TypeScript type).\n\nFor strings, the `basename` or `extname` of files must match them.\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-up@^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-up/workflows/main/badge.svg\n\n[build]: https://github.com/vfile/vfile-find-up/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/vfile/vfile-find-up.svg\n\n[coverage]: https://codecov.io/github/vfile/vfile-find-up\n\n[downloads-badge]: https://img.shields.io/npm/dm/vfile-find-up.svg\n\n[downloads]: https://www.npmjs.com/package/vfile-find-up\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-down]: https://github.com/vfile/vfile-find-down\n\n[api-find-up]: #finduptest-path-callback\n\n[api-find-up-all]: #findupalltest-path-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":1620229144099,"_cnpm_publish_time":1620229144099,"dist-tags":{"latest":"7.1.0"}}