is-error
Detect whether a value is an error
Last updated 8 years ago by mk-pmb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install is-error 
SYNC missed versions from official npm registry.

is-error

Detect whether a value is an error

Example

var isError = require("is-error");

console.log(isError(new Error('hi'))) // true
console.log(isError({ message: 'hi' })) // false

Docs

var bool = isError(maybeErr)

is-error := (maybeErr: Any) => Boolean

isError returns a boolean. it will detect whether the argument is an error or not.

Installation

npm install is-error

Tests

npm test

Contributors

  • Raynos

MIT Licensed

Current Tags

  • 2.2.2                                ...           latest (8 years ago)

5 Versions

  • 2.2.2                                ...           8 years ago
  • 2.2.1                                ...           10 years ago
  • 2.2.0                                ...           12 years ago
  • 2.1.0                                ...           12 years ago
  • 2.0.0                                ...           12 years ago
Downloads
Total 20
Today 0
This Week 0
This Month 7
Last Day 0
Last Week 1
Last Month 5
Dependencies (0)
None
Dev Dependencies (7)
Dependents (4)

© 2010 - cnpmjs.org x YWFE | Home | YWFE