HTTP Convenience Pack (npm package)
The small TypeScript HTTP convenience library; methods, statuses, MIME types, headers enums, types, validators, normalizers, in group
, of group
, make
, extract
etc.
Motivation
Modern applications juggle HTTP methods, status codes, headers, and MIME types—often inconsistently. This package solves:
- Ambiguity: Replace error-prone string literals (
"GET"
,"application/json"
) with type-safe constants. - Team Alignment: Enforce RFC compliance across frontend, backend, and microservices.
- Developer Comfort: IDE autocomplete, hover documentation, and modular APIs.
Key Features
- Zero dependencies: Lightweight and embeddable.
- TypeScript-first: Full inference and generics support.
- RFC-compliant: Methods, statuses, MIME types, headers.
- Convenience utilities: Validation, normalization, and transformations.
- IDE optimized: VS Code autocomplete, doc blocks, and aliasing support.
Technology
- TypeScript (5.7+)
- ESM module format: Modern export strategy with
exports
field - Vitest: Unit testing
- ESLint + markdown-link-check: Code and doc linting
- Husky + Commitlint: Conventional commits with Git hook enforcement
- Custom build pipeline: Uses
tsc
,tsc-alias
, andcpy
for clean dist builds under.delivery/
- Zero runtime dependencies
- Production-ready with semantic versioning, CI hooks, and changelog automation
- Auto-completable constants with named namespaces (e.g.,
HTTPMethods
,HTTPStatuses
)