chance-http-status
v1.1.0
Published
[![npm](https://img.shields.io/npm/v/chance-http-status.svg?style=flat-square)](https://www.npmjs.com/package/chance-http-status) [![Build Status](https://github.com/jonathansamines/chance-http-status/workflows/Node.js%20CI/badge.svg)](https://github.com/
Downloads
6
Maintainers
Readme
chance-http-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 ofinformation
,success
,redirection
,clientError
orserverError
.
httpStatusDefinition
An object with the following properties:
status
A valid http status codemessage
The standard http status message associated with the code