{"_id":"http-codes","_rev":"12-c9f2e3150a24c261f6d5a458f702c134","name":"http-codes","dist-tags":{"latest":"2.1.0"},"versions":{"1.0.0":{"name":"http-codes","version":"1.0.0","keywords":["http","status","codes","messages","builtin","map","javascript","nodejs","node"],"author":{"name":"Ariel Flesler","email":"aflesler@gmail.com"},"license":"MIT","_id":"http-codes@1.0.0","maintainers":[{"name":"flesler","email":"aflesler@gmail.com"}],"bugs":{"url":"https://github.com/flesler/node-http-codes/issues"},"dist":{"shasum":"59dd46f3ccb3037dd1e254aa644ab0f8be15f278","tarball":"https://registry.npmjs.org/http-codes/-/http-codes-1.0.0.tgz","integrity":"sha512-yPS0/Sp66fmRSpZ6rbeFinytku7KnBiLa/CaDxHbcr0gAZuQqeGjgyfElyQ5xPiK21e4oL4iqooHLRcr2s7LoA==","signatures":[{"sig":"MEUCIQD7sOEmfsSK9gUAFzy7WMJsHHCaZFsn+udeOm0uZ4+f/gIgSqv2tvPXjUb6A7oMb2A/7GARs43k4WxUCUzrFr5OVRE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./index.js","_from":".","scripts":{"test":"node test/index"},"_npmUser":{"name":"flesler","email":"aflesler@gmail.com"},"repository":{"url":"git://github.com/flesler/node-http-codes.git","type":"git"},"_npmVersion":"1.3.8","description":"Map of HTTP status messages to codes based on Node's built-in (inverse) map","directories":{},"dependencies":{}},"2.0.0":{"name":"http-codes","version":"2.0.0","keywords":["http","status","codes","messages","builtin","map","javascript","nodejs","node"],"author":{"url":"https://github.com/flesler","name":"Ariel Flesler"},"license":"MIT","_id":"http-codes@2.0.0","maintainers":[{"name":"flesler","email":"aflesler@gmail.com"}],"homepage":"https://github.com/flesler/node-http-codes","bugs":{"url":"https://github.com/flesler/node-http-codes/issues"},"dist":{"shasum":"b12730a49095ad9dde29dd7242b3ae9c777a25e8","tarball":"https://registry.npmjs.org/http-codes/-/http-codes-2.0.0.tgz","fileCount":7,"integrity":"sha512-IARaYaZILGvr+hC4UxYKwUUrJNHe9Utv5hkYo2brlJi+HOjuFm/h23dT0eDkV3xO/XOGnxSNn4tsDQQbmwotRg==","signatures":[{"sig":"MEUCIHl0/zH/LPbFEjswHs5EVQtRB/YCx/l/il/5ndS0m6kZAiEAjnr5oSPMUvQ+XGP4jtMOqKtwUsKstJxyWcjVeuiq+zU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5317},"main":"./dist/http-codes.cjs","type":"module","types":"./dist/http-codes.d.ts","module":"./dist/http-codes.js","engines":{"node":">=14"},"exports":{".":{"types":"./dist/http-codes.d.ts","import":"./dist/http-codes.js","require":"./dist/http-codes.cjs"}},"gitHead":"209b704f8295a8f6cc18f5caaa5827153f7a8138","scripts":{"lint":"eslint --cache --cache-strategy content 'src/**/*.ts' '*.ts'","test":"npm run test:types && npm run test:unit","build":"tsup","lint:fix":"npm run lint -- --fix","test:unit":"vitest run","test:types":"tsc -p tsconfig.test.json --noEmit","test:watch":"vitest --watch","prepublishOnly":"npm run build"},"_npmUser":{"name":"flesler","email":"aflesler@gmail.com"},"repository":{"url":"git://github.com/flesler/node-http-codes.git","type":"git"},"_npmVersion":"11.6.2","description":"Map of HTTP status messages to codes based on Node's built-in (inverse) map","directories":{},"_nodeVersion":"24.11.1","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","eslint":"^9.21.0","vitest":"^3.0.7","@eslint/js":"^9.21.0","typescript":"^5.8.2","@types/node":"^26.1.2","@stylistic/eslint-plugin":"^4.0.1","@typescript-eslint/parser":"^8.24.1","@typescript-eslint/eslint-plugin":"^8.24.1"},"_npmOperationalInternal":{"tmp":"tmp/http-codes_2.0.0_1786031756909_0.2304671625846002","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"http-codes","version":"2.1.0","description":"Map of HTTP status messages to codes based on Node's built-in (inverse) map","keywords":["http","status","codes","messages","builtin","map","javascript","nodejs","node"],"author":{"name":"Ariel Flesler","url":"https://github.com/flesler"},"license":"MIT","homepage":"https://github.com/flesler/node-http-codes","bugs":{"url":"https://github.com/flesler/node-http-codes/issues"},"repository":{"type":"git","url":"git://github.com/flesler/node-http-codes.git"},"type":"module","main":"./dist/http-codes.cjs","module":"./dist/http-codes.js","types":"./dist/http-codes.d.ts","exports":{".":{"types":"./dist/http-codes.d.ts","import":"./dist/http-codes.js","require":"./dist/http-codes.cjs"}},"scripts":{"generate-types":"tsx bin/generate-types.ts","build":"npm run generate-types && tsup","test":"npm run test:types && npm run test:unit","test:types:test":"tsc -p tsconfig.test.json --noEmit","test:types:bin":"tsc -p bin/tsconfig.json --noEmit","test:types":"npm run test:types:test && npm run test:types:bin","test:unit":"vitest run","test:watch":"vitest --watch","lint":"eslint --cache --cache-strategy content '{src,bin}/**/*.ts' '*.ts'","lint:fix":"npm run lint -- --fix","prepublishOnly":"npm run build"},"engines":{"node":">=14"},"devDependencies":{"@eslint/js":"^9.21.0","@stylistic/eslint-plugin":"^4.0.1","@types/node":"^26.1.2","@typescript-eslint/eslint-plugin":"^8.24.1","@typescript-eslint/parser":"^8.24.1","eslint":"^9.21.0","tsup":"^8.4.0","tsx":"^4.19.3","typescript":"^5.8.2","vitest":"^3.0.7"},"gitHead":"651f4761cfef88c88c414e1bdcb2b619d38cb24e","_id":"http-codes@2.1.0","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-YPQGyKqAYyOYIetj7uvJ2bm75BG+J4BGFsJpJjuQui0nN0t08EiFnvcgbs7C/e9Azi4/RhnM43yI4Xr884ggsA==","shasum":"81fdf54b0d7a4fc5cab315232af3fd9214207d4a","tarball":"https://registry.npmjs.org/http-codes/-/http-codes-2.1.0.tgz","fileCount":7,"unpackedSize":10023,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFFVjgnyr6B2nhx9akdu59MpfL0NOPTG/vm33xciCot+AiEAsm4xzPoHN1ovGWsbE/KI5wQ5uDOheGYUNBbF+WTN1rc="}]},"_npmUser":{"name":"flesler","email":"aflesler@gmail.com"},"directories":{},"maintainers":[{"name":"flesler","email":"aflesler@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/http-codes_2.1.0_1786032666992_0.5784010590408211"},"_hasShrinkwrap":false}},"time":{"created":"2014-02-06T18:29:45.704Z","modified":"2026-08-06T16:11:07.328Z","1.0.0":"2014-02-06T18:29:47.619Z","2.0.0":"2026-08-06T15:55:57.044Z","2.1.0":"2026-08-06T16:11:07.138Z"},"bugs":{"url":"https://github.com/flesler/node-http-codes/issues"},"author":{"name":"Ariel Flesler","url":"https://github.com/flesler"},"license":"MIT","homepage":"https://github.com/flesler/node-http-codes","keywords":["http","status","codes","messages","builtin","map","javascript","nodejs","node"],"repository":{"type":"git","url":"git://github.com/flesler/node-http-codes.git"},"description":"Map of HTTP status messages to codes based on Node's built-in (inverse) map","maintainers":[{"name":"flesler","email":"aflesler@gmail.com"}],"readme":"# http-codes\n\nMap of HTTP status messages to codes — the inverse of [Node's built-in `STATUS_CODES`](https://nodejs.org/api/http.html#httpstatuscodes).\n\nStays in sync with Node: when the runtime adds or renames a status, this package picks it up automatically.\n\n[![NPM](https://nodei.co/npm/http-codes.png?compact=true)](https://npmjs.org/package/http-codes)\n\n```bash\nnpm install http-codes\n```\n\n```js\nimport codes from 'http-codes'\n// or\nconst codes = require('http-codes')\n\ncodes.OK          // 200\ncodes.NOT_FOUND   // 404\ncodes.IM_A_TEAPOT // 418\n```\n\n---\n\n## Why use this\n\n- **Ultra simple** — one small module, zero dependencies\n- **Always current** — derived from Node's built-in map at load time\n- **TypeScript types** included\n\n---\n\n## API\n\nThe module exports a plain object. Each key is the status message in `SCREAMING_SNAKE_CASE`; each value is the numeric code.\n\n```js\nimport codes from 'http-codes'\n\nif (res.statusCode === codes.NOT_FOUND) {\n  // …\n}\n```\n\nKeys are normalized from Node's messages: apostrophes removed, hyphens and spaces become underscores, then uppercased (`\"Request Timeout\"` → `REQUEST_TIMEOUT`).\n\nThe exact set of keys depends on your Node version. Run `npm test` to print the current map.\n\n---\n\n## Upgrading from 1.x\n\n**No code changes needed** if you used `require('http-codes')` and property access — that is the entire 1.0.0 API and it is preserved in 2.0.0.\n\n2.0.0 is a major release because of packaging (TypeScript, `dist/`, dual ESM/CJS, built-in types, tooling) and the long gap since 1.0.0 — not because the `require()` shape changed.\n\nFull compatibility matrix, dependent-audit commands, and smoke tests: [docs/backwards-compatibility.md](docs/backwards-compatibility.md).\n\n---\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","readmeFilename":"README.md","users":{"duzun":true}}