@southfarm/http-status

0.0.2 • Public • Published

http-status

Build Status

A simple boilerplate for es6/es7 project, you can start your npm module from this.

Only with neccessary key features:

  • babel
  • commitlint
  • eslint
  • flow
  • husky
  • jest
  • prettier
  • remark
  • standard-version

Usage

npm i --save @south-farm/http-status

in your js file

import httpStatus from "@south-farm/http-status";

// or
// import NotFound from "@south-farm/http-status/not-found";

(req, res, next) => {
  const err = new httpStatus.NotFound();
  res.status(err.statusCode).json(err);
};

All deinfed error

  • InvalidRequest: 400
  • Unauthorized: 401
  • Forbidden: 403
  • NotFound: 404
  • NotAcceptable: 406
  • Gone: 410
  • UnprocessableEntity: 422
  • InternalError: 500

Package Sidebar

Install

npm i @southfarm/http-status

Weekly Downloads

3

Version

0.0.2

License

MIT

Last publish

Collaborators

  • zzswang