1.1.0 • Published 4 years ago

chance-http-status v1.1.0

Weekly downloads
4
License
ISC
Repository
github
Last release
4 years ago

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
1.1.0

4 years ago

1.0.0

6 years ago