# type-of

> Type assertions aka less-broken typeof.

Latest version **2.0.1** (published 2014-01-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install type-of
pnpm add type-of
yarn add type-of
bun add type-of
```

## 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 | 2.0.1 |
| Published | 2014-01-06 |
| First published | 2013-06-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | forbeslindesay |

## Links

- npm: https://www.npmjs.com/package/type-of
- Repository: https://github.com/ForbesLindesay/type-of
- Issues: https://github.com/ForbesLindesay/type-of/issues
- npm.io page: https://npm.io/package/type-of

## Recent versions

- 2.0.1 (latest) — 2014-01-06
- 2.0.0 — 2013-06-28

## README

# type-of

  Type assertions aka less-broken `typeof`.


[![Build Status](https://travis-ci.org/ForbesLindesay/type-of.png?branch=master)](https://travis-ci.org/ForbesLindesay/type-of)
[![Dependency Status](https://gemnasium.com/ForbesLindesay/type-of.png)](https://gemnasium.com/ForbesLindesay/type-of)
[![NPM version](https://badge.fury.io/js/type-of.png)](http://badge.fury.io/js/type-of)

[![browser support](https://ci.testling.com/ForbesLindesay/type-of.png)](https://ci.testling.com/ForbesLindesay/type-of)

## Example

```js
var type = require('type-of')

var obj = new Date
if (type(obj) == 'date') ...
```

## API

```js
type(new Date) == 'date'
type({}) == 'object'
type(null) == 'null'
type(undefined) == 'undefined'
type("hey") == 'string'
type(true) == 'boolean'
type(false) == 'boolean'
type(12) == 'number'
type(type) == 'function'
type(/asdf/) == 'regexp'
type((function(){ return arguments })()) == 'arguments'
type([]) == 'array'
type(document.createElement('div')) == 'element'
```

## License

  MIT

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