Skip to content
HTTP methods as a TypeScript enum.
Branch: master
Clone or download
Pull request Compare This branch is 38 commits behind typeslick:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
__meta__
src
.babelrc.js
.gitignore
.prettierrc.json
CODE_OF_CONDUCT.md
LICENSE
README.md
api-extractor.json
cSpell.json
jest.config.js
package.json
tsconfig.json
tslint.json

README.md

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 { HTTPMethod } 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

You can’t perform that action at this time.