This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@tshttp/header
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@tshttp/header 📰

Ultra typed, over documented, and neatly organised HTTP header enums, to use for a great developper experience.

Get started

yarn add @tshttp/header
npm install @tshttp/header
import { Header } from '@tshttp/header'

req.header(Header.ContentType)

Enums

Header enum is composed of the following exported enums:

  • RequestHeader for the HTTP request headers.
  • ResponseHeader for the HTTP response headers.
import { RequestHeader, ResponseHeader } from '@tshttp/header'

req.get(RequestHeader.XForwardedFor)
res.set(ResponseHeader.Allow, 'GET')

These enums are actually object litterals with a const assertion.`

Unions

When use as a type, each category is a union of corresponding headers.

import { Header, ResponseHeader } from '@tshttp/status'

function setHeader(name: ResponseHeader, value: string) {
  //...
}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Published

Version History

  • Version
    Downloads (Last 7 Days)
    • Published

Package Sidebar

Install

npm i @tshttp/header

Weekly Downloads

15

Version

2.0.0

License

MIT

Unpacked Size

89.8 kB

Total Files

8

Last publish

Collaborators

  • jeben