header-field
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published


Header-Field
API Stability TypeScript Styled with prettier Build status Test Coverage NPM Version Downloads Browser Bundle Size

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!

Package Sidebar

Install

npm i header-field

Weekly Downloads

50

Version

1.0.5

License

MIT

Last publish

Collaborators

  • dylanpiercey