{"name":"find-up","description":"Find a file or directory by walking up parent directories","dist-tags":{"latest":"4.1.0"},"versions":{"4.1.0":{"name":"find-up","version":"4.1.0","description":"Find a file or directory by walking up parent directories","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/find-up.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"dependencies":{"locate-path":"^5.0.0","path-exists":"^4.0.0"},"devDependencies":{"ava":"^2.1.0","is-path-inside":"^2.1.0","tempy":"^0.3.0","tsd":"^0.7.3","xo":"^0.24.0"},"gitHead":"6c32f0caed1684ef778053b6f79b13a772e22ba4","bugs":{"url":"https://github.com/sindresorhus/find-up/issues"},"_id":"find-up@4.1.0","_nodeVersion":"8.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==","shasum":"97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19","tarball":"http://localhost:4260/find-up/find-up-4.1.0.tgz","fileCount":5,"unpackedSize":11611,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdBzEzCRA9TVsSAnZWagAA7ZwQAJUrXCf9gkIYlisJcBE6\n2Wzq80Qhyy1k36PLbZPOIgwJsRyN81OGxhQQ5dlzvSIdyvXmJveNSm85+9pC\naN+th01evbkcCVLo6hoPwZyjv/CxWPjdKKqbF0dTBJwY8zCW+g0zDm/TUdlW\nZvlIncpN/AUSOjBpnmd8jYSC+wbedQ3JBCJi0ETSBYIVOuNwKUr14F0wl25+\nCZIAZB2D9VUMP+ZgT+F5z64OiUz1/+Q+U4VtXU0ivJ7OQfX3obNRqRx33KS7\nvBDHgVpeCh5ryMXNEGMZFblzR1qUOewik9/YdQ9e848SbhNu9oSfh4FaEg5X\n6ybitbPf7oOBQudM+LdJofhFkqJgUM8E+/eKtUxWZx6S2FmxbHltrjchAliW\n8JARBCQ2g0OqqyPPFOyWtQlImWr9BYcm2nyZqjA5Tj6jbGTsxkMaPK0YS89g\nAwXxJA5bXn3Xp8KTxFmxJUNJ0zDf5eRhWaZEIX/Tm2qpdEB2+kYbE9QfdOtV\nTo+Y7ZIg5mE44sDi5oN6LLmic+eHlTqtUaqaRS36Lecx65NbCBQY8fkxPNQp\ndJE/qYMRNOWMiNpA8yXqxpaXTtBUopFCpZ1ahTBUpQVP5pKVxX3uoPAbTT2Q\nzUvs1S2b0zo1sFAt3LpCgs24gyTu0WJTyMTFEKrTsk5nALPCpU93o5rUnJ0L\nSUUW\r\n=2E9L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHBGxf/EBWSrVAFVhJNToCIC1Kea1biltBR/pXbgCD5YAiAQx1O3FKsgP0EMKJKabUF+1z6isUPkSNEaWr0iaFeSvw=="}]},"directories":{},"_hasShrinkwrap":false}},"readme":"#find-up\n\n>Findafileordirectorybywalkingupparentdirectories\n\n##Install\n\n```\n$npminstallfind-up\n```\n\n##Usage\n\n```\n/\n└──Users\n└──sindresorhus\n├──unicorn.png\n└──foo\n└──bar\n├──baz\n└──example.js\n```\n\n`example.js`\n\n```js\nimportpathfrom'node:path';\nimport{findUp,pathExists}from'find-up';\n\nconsole.log(awaitfindUp('unicorn.png'));\n//=> '/Users/sindresorhus/unicorn.png'\n\nconsole.log(await findUp(['rainbow.png', 'unicorn.png']));\n//=> '/Users/sindresorhus/unicorn.png'\n\nconsole.log(await findUp(async directory => {\n\tconst hasUnicorns = await pathExists(path.join(directory, 'unicorn.png'));\n\treturn hasUnicorns && directory;\n}, {type: 'directory'}));\n//=> '/Users/sindresorhus'\n```\n\n## API\n\n### findUp(name, options?)\n### findUp(matcher, options?)\n\nReturns a `Promise` for either the path or `undefined` if it couldn't be found.\n\n### findUp([...name], options?)\n\nReturns a `Promise` for either the first path found (by respecting the order of the array) or `undefined` if none could be found.\n\n### findUpMultiple(name, options?)\n### findUpMultiple(matcher, options?)\n\nReturns a `Promise` for either an array of paths or an empty array if none could be found.\n\n### findUpMultiple([...name], options?)\n\nReturns a `Promise` for either an array of the first paths found (by respecting the order of the array) or an empty array if none could be found.\n\n### findUpSync(name, options?)\n### findUpSync(matcher, options?)\n\nReturns a path or `undefined` if it couldn't be found.\n\n### findUpSync([...name], options?)\n\nReturns the first path found (by respecting the order of the array) or `undefined` if none could be found.\n\