is-error
Detect whether a value is an error
Last updated 7 years ago by mk-pmb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm 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 (7 years ago)

5 Versions

  • 2.2.2                                ...           7 years ago
  • 2.2.1                                ...           9 years ago
  • 2.2.0                                ...           11 years ago
  • 2.1.0                                ...           11 years ago
  • 2.0.0                                ...           11 years ago
Downloads
Today 0
This Week 1
This Month 1
Last Day 1
Last Week 3
Last Month 5
Dependencies (0)
None
Dev Dependencies (7)
Dependents (3)

Copyright 2013 - present © cnpmjs.org | Home |