header-field
v1.0.5
Published
Properly format a header field into a lowercased hyphenated string.
Downloads
205
Maintainers
Readme
Transform header fields into a properly formatted string, with lowercase characters and hyphens.
Installation
Npm
npm install header-field
Example
import { normalize } from "header-field";
normalize("content-type"); //-> "content-type"
normalize("content-Length"); //-> "content-length"
normalize("Content-Disposition"); //-> "content-disposition"
// Special case: referrer -> referer.
normalize("Referrer"); //-> "referer"
Contributions
- Use
npm test
to build and run tests.
Please feel free to create a PR!