{"_id":"@blaahaj/remap-errno","_rev":"2-85b3066398ed075d12f6e1edb24983bd","name":"@blaahaj/remap-errno","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@blaahaj/remap-errno","version":"1.0.0","keywords":[],"author":{"name":"Rachel Evans","email":"rachel@rachelevans.org"},"license":"ISC","_id":"@blaahaj/remap-errno@1.0.0","maintainers":[{"name":"rvedotrc","email":"npm-20151125@rve.org.uk"}],"dist":{"shasum":"dc386db7dc215025e12f4492cc3662ea531faef7","tarball":"https://registry.npmjs.org/@blaahaj/remap-errno/-/remap-errno-1.0.0.tgz","fileCount":9,"integrity":"sha512-DVRj1reGsWqcXMClNuxWHXFPpRwzu5pTI7yTcwAV6HVsRUBQQOmmRNR/Vj0uUC3gD8VngL5fMarpb6kqUe1eDw==","signatures":[{"sig":"MEUCICC0zmzgA2+piePulR2iPWHAdZYCesLg99OPTSwJ9rqoAiEA/ZymvPsHEZzQDPED9QdcB+9UqxW+VqaXANcKvnXRqQ4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3485},"type":"module","_from":"file:blaahaj-remap-errno-1.0.0.tgz","exports":{".":{"types":"./dist/src/index.d.ts","default":"./dist/src/index.js"}},"scripts":{"test":"concurrently 'npm:test:*'","build":"tsc","format":"prettier --write .","test:unit":"echo \"Warning: no test specified\" >&2 && exit 0","test:format":"prettier --check ."},"_npmUser":{"name":"rvedotrc","email":"npm-20151125@rve.org.uk"},"_resolved":"/home/runner/work/remap-errno/remap-errno/blaahaj-remap-errno-1.0.0.tgz","_integrity":"sha512-DVRj1reGsWqcXMClNuxWHXFPpRwzu5pTI7yTcwAV6HVsRUBQQOmmRNR/Vj0uUC3gD8VngL5fMarpb6kqUe1eDw==","_npmVersion":"11.6.0","description":"Simplify extraction and handling of ENOENT, etc from 'error.code'","directories":{},"_nodeVersion":"24.8.0","_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.5.3","typescript":"^5.8.3","@types/node":"24.4.0","concurrently":"^9.1.2","@commitlint/config-conventional":"^20.2.0"},"_npmOperationalInternal":{"tmp":"tmp/remap-errno_1.0.0_1765831694319_0.25998063714785946","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@blaahaj/remap-errno","version":"1.0.1","description":"Simplify extraction and handling of ENOENT, etc from 'error.code'","type":"module","exports":{".":{"default":"./dist/src/index.js","types":"./dist/src/index.d.ts"}},"keywords":[],"author":{"name":"Rachel Evans","email":"rachel@rachelevans.org"},"license":"ISC","devDependencies":{"@commitlint/config-conventional":"^20.2.0","@types/node":"24.4.0","concurrently":"^9.1.2","prettier":"^3.5.3","typescript":"^5.8.3"},"scripts":{"build":"tsc","format":"prettier --write .","test":"concurrently 'npm:test:*'","test:format":"prettier --check .","test:unit":"echo \"Warning: no test specified\" >&2 && exit 0"},"_id":"@blaahaj/remap-errno@1.0.1","_integrity":"sha512-LdUmQzybEHLr+3Fpt94VX6bw6DKSUUYsnOYvlFK6fTlTttkwmaNdaY40yPcS3Hvdg+l4hc1ko1dxyOj0ahnFPA==","_resolved":"/home/runner/work/remap-errno/remap-errno/blaahaj-remap-errno-1.0.1.tgz","_from":"file:blaahaj-remap-errno-1.0.1.tgz","_nodeVersion":"24.8.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-LdUmQzybEHLr+3Fpt94VX6bw6DKSUUYsnOYvlFK6fTlTttkwmaNdaY40yPcS3Hvdg+l4hc1ko1dxyOj0ahnFPA==","shasum":"65ad238fd213ae268683defe47111ffcc4cad1ac","tarball":"https://registry.npmjs.org/@blaahaj/remap-errno/-/remap-errno-1.0.1.tgz","fileCount":19,"unpackedSize":6521,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIESQ0AFkMre9FuC2vJMgEDGQIlPV2jnCd+8n76tujbyfAiBi68R1Z830al5Phz3ESoNtFiD1koFfv77LxBi+qMSoIw=="}]},"_npmUser":{"name":"rvedotrc","email":"npm-20151125@rve.org.uk"},"directories":{},"maintainers":[{"name":"rvedotrc","email":"npm-20151125@rve.org.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/remap-errno_1.0.1_1765833730710_0.721556649142721"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-15T20:48:14.239Z","modified":"2025-12-15T21:22:11.080Z","1.0.0":"2025-12-15T20:48:14.494Z","1.0.1":"2025-12-15T21:22:10.865Z"},"author":{"name":"Rachel Evans","email":"rachel@rachelevans.org"},"license":"ISC","keywords":[],"description":"Simplify extraction and handling of ENOENT, etc from 'error.code'","maintainers":[{"name":"rvedotrc","email":"npm-20151125@rve.org.uk"}],"readme":"# @blaahaj/remap-errno\n\nA node module to simplify the extraction and handling of `ENOENT`, etc from `error.code`.\n\n## Usage\n\nA type to hold `errno` codes:\n\n```js\n// \"EPERM\" | \"ENOENT\" | \"EISDIR\" | ...\nimport { type Errno } from \"@blaahaj/remap-errno\";\n```\n\nExtract an `Errno` from an error:\n\n```js\nimport { errnoFrom } from \"@blaahaj/remap-errno\";\nimport { readFile } from \"node:fs/promises\";\n\nawait readFile(\"no such file!!\").catch((error) => {\n  const errno = errnoFrom(error); // Errno | undefined\n  // ...\n});\n```\n\nTurn errors with specific `Errno` values, into non-error values:\n\n```js\nimport { remapErrno } from \"@blaahaj/remap-errno\";\nimport { readFile } from \"node:fs/promises\";\n\nconst readFileIfExists = remapErrno(readFile, {\n  ENOENT: undefined,\n  EPERM: undefined,\n});\nconst content = await readFileIfExists(\"somefile.json\", \"utf-8\"); // string | undefined\n```\n\nAny errors not listed in the mapping are left unchanged, i.e. are still thrown.\n","readmeFilename":"README.md"}