chance-http-status

1.1.0 • Public • Published

chance-http-status

npm Build Status

A simple chance mixin to generate random http status information

Installation

npm install --save chance-http-status

Usage

  const chance = require('chance');
  const httpStatus = require('chance-http-status');
 
  chance.mixin({ httpStatus });
 
  chance.httpStatus({ classType: 'success' });
 
  // => {
  //  "status": 200,
  //  "message": "successful",
  // }

API

chance.httpStatus(options) => httpStatusDefinition

  • options
    • options.classType: The type of http status code. Can be one of information, success, redirection, clientError or serverError.

httpStatusDefinition

An object with the following properties:

  • status A valid http status code
  • message The standard http status message associated with the code

Readme

Keywords

Package Sidebar

Install

npm i chance-http-status

Weekly Downloads

0

Version

1.1.0

License

ISC

Unpacked Size

8.03 kB

Total Files

11

Last publish

Collaborators

  • jonathansamines