# typeof

> Node module. typeOf('a string') == 'string', typeOf([]) == 'array', etc.. Also supports named functions detections aka javascript classes

Latest version **1.0.0** (published 2013-11-21) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2013-11-21 |
| First published | 2012-10-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/typeof) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Seva Rybakov |
| Maintainers | codingfu |
| Keywords | typeof, type |

## Links

- npm: https://www.npmjs.com/package/typeof
- Repository: http://github.com/CodingFu/typeof
- Issues: https://github.com/CodingFu/typeof/issues
- npm.io page: https://npm.io/package/typeof

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2013-11-21
- 0.9.1 — 2013-04-10
- 0.9.0 — 2012-10-30

## README

# typeof

Small node.js module that dramatically extends functionality of native typeof

Inspired by Batman.js typeOf util

**UPD:** now it returns lowercased name of any javascript class. Thanks to @BallBearing for idea

## Usage:

```bash
$ npm install typeof
```

```javascript
var typeOf = require('typeof');

console.log(typeOf("a string"));
// -> "string"

console.log(typeOf([1, 2, 3, "array"]));
// -> "array"

console.log(typeOf(null));
// -> "null"

console.log(typeOf(new Buffer(0)));
// -> "buffer"

function MyClass() {
  this.is = "class constructor"  
}
console.log(typeOf(new MyClass));
// ->"myclass"
```

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