Skip to content

DylanPiercey/header-field

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


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!

About

☂️ Properly format a header field into a capitalized hyphenated string.

Resources

License

Stars

Watchers

Forks

Packages

No packages published