1.1.0 • Published 4 years ago

thing-assert v1.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

thing-assert

GitHub license npm version Build Status codecov PRs Welcome Known Vulnerabilities npm download

Description

Nodejs's assert error has no status code. Through thing-assert you can define your own error status and capture from the thrown out error object.

Install

$ npm i thing-assert

Usage

const thingAssert = require('thing-assert')

try {
  thingAssert(false, 'error message', 400)
} catch (error) {
  console.log(error.status) // output 400
}

Questions & Suggestions

Please open an issue here.

License

MIT