Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@status/codes

Package Overview
Dependencies
Maintainers
0
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@status/codes

A collection of status code enums

  • 1.7.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Status Codes

npm (scoped) NPM

A collection of status code enums.

Available Enums

  • Apache
  • Auth0
  • Braintree
  • Cloudflare
  • FirebaseAuth
  • FTP
  • Http
  • IIS
  • IRC
  • Mocha
  • MongoDB
  • Mongoose *wip
  • Nginx
  • Node
  • Postgres
  • Twitter

Install

npm:
npm install @status/codes

yarn:
yarn add @status/codes

Example Usage

import { Http } from '@status/codes';

export class NotFoundError extends Error {
  readonly code = Http.NotFound;
}

Use with express:

const { Http } = require('@status/codes');

create(request, response) {
  return Model.create(request.body)
    .then(instance => response.status(Http.Created).json(instance))
    .catch(error => response.status(Http.Conflict).json(error))
}

Keywords

FAQs

Package last updated on 10 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc