{"_id":"discover-path","_rev":"1-8d9b53d9e899f2e560207e11b7c1cbe1","name":"discover-path","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"discover-path","version":"1.0.0","description":"Check for the existence of a path in a case-sensitive manner and, if not found, suggest where it might be at","main":"cjs/discover-path.js","typings":"cjs/discover-path.d.ts","module":"esm/discover-path.mjs","sideEffects":false,"engines":{"node":">=10.0.0"},"scripts":{"start":"tsdx watch","prebuild":"rm -rf cjs esm","build":"tsc && tsc -m es2020 --outDir esm && mv esm/discover-path.js esm/discover-path.mjs","test":"tsdx test","posttest":"npm run lint","lint":"tsdx lint src","prepublishOnly":"npm run build && npm test","coverage":"tsdx test --coverage"},"repository":{"type":"git","url":"git+ssh://git@github.com/rexxars/discover-path.git"},"keywords":["path","exists","exist","file","filepath","fs","filesystem","file-system","access","stat","case","case-sensitive"],"author":{"name":"Espen Hovlandsdal","email":"espen@hovlandsdal.com"},"license":"MIT","bugs":{"url":"https://github.com/rexxars/discover-path/issues"},"homepage":"https://github.com/rexxars/discover-path#readme","devDependencies":{"@types/jest":"^26.0.13","@typescript-eslint/eslint-plugin":"^4.1.0","@typescript-eslint/parser":"^4.1.0","eslint-config-prettier":"^6.11.0","eslint-config-sanity":"^1.150.8","prettier":"^2.0.5","tsdx":"^0.14.1","typescript":"^3.0.0"},"prettier":{"semi":false,"printWidth":100,"bracketSpacing":false,"singleQuote":true},"eslintConfig":{"root":true,"env":{"node":true,"browser":false},"parser":"@typescript-eslint/parser","extends":["plugin:@typescript-eslint/recommended","prettier/@typescript-eslint","sanity","prettier"],"rules":{"prettier/prettier":"error","operator-linebreak":"off","no-use-before-define":"off","no-sync":"off"},"plugins":["@typescript-eslint","prettier"]},"jest":{"globals":{"ts-jest":{"diagnostics":false}}},"gitHead":"6d94dc3e26efa3ee7eadd8ddf10cf1f6f33b197d","_id":"discover-path@1.0.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.11","dist":{"integrity":"sha512-dP4ylkw7tK/uyfgvH6B9FSP2XHFinM7lL9eB8vvJbVaZQgK9BfZCGoUEv4LzBY1I08MMJv7ppnw+BW19ic20pA==","shasum":"97fada98028809356813936257475fad7c1f3638","tarball":"https://registry.npmjs.org/discover-path/-/discover-path-1.0.0.tgz","fileCount":5,"unpackedSize":11195,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgF4CgCRA9TVsSAnZWagAA6s0P/RMzUuGAdwqFVOChiYz3\nG5T1yGoCaRtwbuG2KwZNwDroqfBSa9HTc3WmxCRDOxwpjb5sLReZZqCA/J8e\nvMIySyVkGrPFS6HkWDooa3dwocQ9TWCo7T/RmcTXTV7IvxGP2CINYDtWIigt\nRH/IR2fT9jWC571MKu6qc0mnY12Jl0EpgO3jAqj2N+D31WLeGMGY49flyYD3\nLKHtdAiEqSf1L1mkjDX0u+wQcS2LfJmXK1ileT2K9UUmqmcryn06ny9KhXBn\nOVbWuv0jzRYg43HebgHigWzl6wDWc2RJFqfdd3n7xpKfTVvH3qdyJBtit7Uj\ncfeHVpktSpuHRkz6iGnC3dnAiBkrw/Uxtbd0A51IZhHdhZoKh+WGNNtj+m7d\no3AYalS8xAzKA9iN02JvbQWvcXtQm6BDKVaj0jOQVzhT9nSdK0GnnYP0ChQ9\na8IL5JDtoM8MJ9G6hL3IYJHdW+6mL0kVhT+3m5n7f+z0Hr/kV1J/ewWMchKr\nYOK/WCFD4oyIetmnT7JHXcrye/7KlBrxSxnvlF/G22RXLxl0QS6jhyVPvaz+\nFiecvTYUMs4AtE5mp397Ru8D2T5CRSlcmrLGAYzDG/5QRmA3Mci8Kiz8caoj\n7mHWdJ3NecLDhyg6aKqxEOCF6UJf63SZHaooM/Uww1mIW/385Se23U3S/4gn\nf5Qz\r\n=428l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHHMaCFX35aJhNBiW7faNtFmkOF+3tJD0ECsboArYjmdAiEAv5yNKS0e1qnzyuidRb309Phm572w5YIva2cPSwcBhfs="}]},"_npmUser":{"name":"rexxars","email":"espen@hovlandsdal.com"},"directories":{},"maintainers":[{"name":"rexxars","email":"espen@hovlandsdal.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/discover-path_1.0.0_1612152991535_0.8087239646163964"},"_hasShrinkwrap":false}},"time":{"created":"2021-02-01T04:16:31.535Z","1.0.0":"2021-02-01T04:16:31.673Z","modified":"2022-04-28T22:22:06.603Z"},"maintainers":[{"name":"rexxars","email":"espen@hovlandsdal.com"}],"description":"Check for the existence of a path in a case-sensitive manner and, if not found, suggest where it might be at","homepage":"https://github.com/rexxars/discover-path#readme","keywords":["path","exists","exist","file","filepath","fs","filesystem","file-system","access","stat","case","case-sensitive"],"repository":{"type":"git","url":"git+ssh://git@github.com/rexxars/discover-path.git"},"author":{"name":"Espen Hovlandsdal","email":"espen@hovlandsdal.com"},"bugs":{"url":"https://github.com/rexxars/discover-path/issues"},"license":"MIT","readme":"# discover-path\n\n[![npm version](https://img.shields.io/npm/v/discover-path.svg?style=flat-square)](https://www.npmjs.com/package/discover-path)[![Build Status](https://img.shields.io/github/workflow/status/rexxars/discover-path/CI/main.svg?style=flat-square)](https://github.com/rexxars/discover-path/actions?query=workflow%3ACI)\n\nCheck for the existence of a path in a case-sensitive manner and, if not found, suggest where it might be at.\n\nNote that this is a slow operation (recursively listing directory contents), and should only be used in cases where that's fine (CLI tools in the case of errors, for instance).\n\n## Installing\n\n```sh\n$ npm install discover-path\n```\n\n## Usage\n\n```js\nimport {discoverPathSync} from 'discover-path'\n\nconst expectedPath = '/Users/Rexxars/webdev/discover-Path'\nconst actualPath = discoverPathSync(expectedPath)\n\n// If a \"direct\" match is found (1:1, or on case-changes with only one option:)\nconsole.log(actualPath) // /Users/rexxars/webdev/discover-path\n```\n\n- If a 1:1 match can be found (or, if changing the casing of paths, only one option is found), the actual, \"fixed\" (case-sensitive) path is returned.\n- If no direct matches was found, or its unclear which alternative to use, it will throw an error. The error object contains a list of suggestions if any can be found. This array of options can also be found on the `suggestions` property on the error.\n\n```js\nimport {discoverPathSync} from 'discover-path'\n\ntry {\n  const expectedPath = '/Users/rexxars/webdev/Discover-Path'\n  const actualPath = discoverPathSync(expectedPath)\n} catch (err) {\n  console.log(err.code) // 'ENOENT'\n  console.log(err.path) // '/Users/rexxars/webdev/Discover-Path'\n  console.log(err.suggestions)\n  /*\n  [\n    '/Users/rexxars/webdev/discover-path',\n    '/Users/rexxars/webdev/discover-Path'\n  ]\n  */\n\n  console.log(err.message)\n  /*\n  Cannot find path '/Users/Rexxars/webdev/Discover-Path'\n\n  Did you mean:\n    - /Users/rexxars/webdev/discover-path\n    - /Users/rexxars/webdev/discover-Path\n  */\n}\n```\n\n## License\n\nMIT © Espen Hovlandsdal\n","readmeFilename":"README.md"}