is-error
Detect whether a value is an error
Last updated 10 years ago by raynos .
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 (6 years ago)

5 Versions

  • 2.2.2                                ...           6 years ago
  • 2.2.1                                ...           8 years ago
  • 2.2.0                                ...           9 years ago
  • 2.1.0                                ...           10 years ago
  • 2.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Total 1
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (7)
Dependents (3)

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