ltrl-http is a JavaScript/TypeScript library that provides a comprehensive, type-safe collection of HTTP status codes and their corresponding descriptions. It offers both numerical codes and string statuses, along with utility functions for validation and resolution. Currently at version 0.0.20, the package demonstrates a rapid release cadence with frequent patch and minor updates, often related to broader `ltrl` monorepo enhancements, particularly around Nuxt.js integration. Its key differentiators include strong TypeScript typing for HTTP codes and statuses, allowing for compile-time safety, and helper functions like `isHTTPCode` and `useHTTPCode` to work with these values programmatically. It aims to simplify handling HTTP responses by providing a consistent and robust interface for standard HTTP semantics.
npm install ltrl-httpVerified import paths — ran on the pinned version, not inferred.
Demonstrates importing `status` for direct code access, `isHTTPCode` for validation, and `HTTPCode` for type safety.
Review any code that directly accesses the configuration object returned by `useHTTPCodeConfig()` and update field names from `key` or `label` to `id` as appropriate.
Use exact version numbers (e.g., `"ltrl-http": "0.0.20"`) in `package.json` and regularly review changelogs before upgrading.
Ensure the import statement `import { status } from 'ltrl-http';` is at the top of your file and that your environment supports ES Modules. If using CommonJS, consider transpiling or using dynamic import if available.Ensure `ltrl-http` is installed (`npm install ltrl-http` or `pnpm add ltrl-http`) and that `moduleResolution` in your `tsconfig.json` is set to a suitable value like `Node16` or `Bundler` for modern module resolution.
No dependency data recorded yet.