# instanceof

> JavaScript all types detection module (crossbrowser)

Latest version **1.0.6** (published 2016-11-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install instanceof
pnpm add instanceof
yarn add instanceof
bun add instanceof
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2016-11-01 |
| First published | 2016-04-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | KROT47 |
| Maintainers | krot47 |
| Keywords | instanceof, typeof |

## Links

- npm: https://www.npmjs.com/package/instanceof
- Repository: https://github.com/KROT47/instanceof
- Homepage: https://github.com/KROT47/instanceof#readme
- Issues: https://github.com/KROT47/instanceof/issues
- npm.io page: https://npm.io/package/instanceof

## Recent versions

- 1.0.6 (latest) — 2016-11-01
- 1.0.5 — 2016-11-01
- 1.0.4 — 2016-06-25
- 1.0.3 — 2016-06-25
- 1.0.2 — 2016-04-02
- 1.0.1 — 2016-04-02

## README

# Instanceof

Checks if variable is instance of some constructor.  
Also can detect any type with Instanceof.getType()  

**Usage:**

```js
const Instanceof = require( 'instanceof' );

// Instanceof( {mixed}, {Array|mixed} ) => Boolean

Instanceof( 123, Number );                                  // true
Instanceof( 123, [ Number, Array, String, 'Boolean' ] );    // true
Instanceof( [], [ Number, Array ] );                        // true
Instanceof( [], 'Array' );                                  // true
Instanceof( NaN, NaN );                                     // true
Instanceof( Object, Function );                             // true

Instanceof( '123', Number );                                // false
Instanceof( Object, Object );                               // false
Instanceof( Object, [ Object, 'NaN', 'Null', null ] );      // false
Instanceof( 123, [ Object, 'NaN', 'Null', null, 'null' ] ); // false

// --- GetType ---

Instanceof.getType( NaN );									// 'NaN'
Instanceof.getType( { a: 123 } );							// 'object'
Instanceof.getType( [ 1, 2, 3 ] );							// 'array'
Instanceof.getType( null );									// 'null'
```

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