http-method-enum
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

http-method-enum

HTTP methods as a TypeScript enum.

tslint: Slick code style: Prettier npm semantic-release License

Install

$ npm install http-method-enum

Usage

Node.js / CommonJS:

const { HTTPMethod } = require('http-method-enum')

ESNext / TypeScript:

import { StatusCode } from 'http-method-enum'
 
if (res.method = HTTPMethod.GET) {
  // ...
}

All current standard HTTP methods are available as follows:

  • CONNECT = 'CONNECT'
  • DELETE = 'DELETE'
  • GET = 'GET'
  • HEAD = 'HEAD'
  • OPTIONS = 'OPTIONS'
  • PATCH = 'PATCH'
  • POST = 'POST'
  • PUT = 'PUT'
  • TRACE = 'TRACE'

Related

News and Updates

Follow @typeslick on Twitter for the latest updates and new project announcements.

Sponsors

Maintainers

License

MIT

/http-method-enum/

    Package Sidebar

    Install

    npm i http-method-enum

    Weekly Downloads

    14,238

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    9.83 kB

    Total Files

    8

    Last publish

    Collaborators

    • jayrylan