# is-error-constructor

> Check if a value is an error constructor

Latest version **3.0.0** (published 2021-04-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-error-constructor
pnpm add is-error-constructor
yarn add is-error-constructor
bun add is-error-constructor
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2021-04-07 |
| First published | 2016-10-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 2.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | is, error, constructor, ctor, check, detect, instanceof |

## Links

- npm: https://www.npmjs.com/package/is-error-constructor
- Repository: https://github.com/sindresorhus/is-error-constructor
- Homepage: https://github.com/sindresorhus/is-error-constructor#readme
- Issues: https://github.com/sindresorhus/is-error-constructor/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/is-error-constructor

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2021-04-07
- 2.1.0 — 2019-04-05
- 2.0.0 — 2019-03-11
- 1.0.1 — 2016-10-26
- 1.0.0 — 2016-10-22

## README

# is-error-constructor

> Check if a value is an error constructor

## Install

```
$ npm install is-error-constructor
```

## Usage

```js
import isErrorConstructor from 'is-error-constructor';

isErrorConstructor(Error);
//=> true

isErrorConstructor(RangeError);
//=> true

function FakeError() {}
isErrorConstructor(FakeError);
//=> false

class UnicornError extends Error {}
isErrorConstructor(UnicornError);
//=> true
```

## Related

- [is](https://github.com/sindresorhus/is) - Type check values

---
_Source: https://npm.io/package/is-error-constructor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
