know-your-http-well is a JavaScript package that provides structured data for various HTTP specifications, including headers, media types, methods, relations, and status codes. It summarizes these elements and links directly to their respective RFCs and specifications. The current stable version is v0.6.0, with minor content updates driving recent releases. Its primary use case is to offer programmatic access to standardized HTTP information, such as converting status phrases to codes and vice-versa, making it useful for both server-side and client-side applications that need to interpret or generate HTTP messages correctly. The project serves as a reference data set, updated periodically with new RFCs and corrections, rather than offering complex runtime functionality or a rapid release cadence for API changes. Its key differentiator is providing this data in an easily consumable JSON and JavaScript format, directly referencing official specifications.
npm install know-your-http-wellVerified import paths — ran on the pinned version, not inferred.
Demonstrates importing the package using CommonJS and accessing HTTP status code utilities for both numerical codes and their corresponding phrases.
For ESM, use `import * as httpWell from 'know-your-http-well';` and access properties as `httpWell.statusPhrasesToCodes`. Alternatively, ensure your build setup correctly handles CommonJS interoperability.
Consult the changelog for each new version to understand any structural changes to the exported data objects, especially if you rely on specific keys or formats.
For ESM, change `const httpWell = require('know-your-http-well');` to `import * as httpWell from 'know-your-http-well';`. If you need CommonJS specifically in an ESM file, use `import { createRequire } from 'module'; const require = createRequire(import.meta.url);`.Ensure you are importing the package correctly, especially in ESM environments. Use `import * as httpWell from 'know-your-http-well';` then access `httpWell.statusPhrasesToCodes.NOT_FOUND`. Verify the exact case ('NOT_FOUND' vs 'NotFound') for status codes.No dependency data recorded yet.