# better-typeof

> Like typeof, but not awful.

Latest version **2.0.0** (published 2017-12-02) · ISC license · 0 weekly downloads

## Install

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

## 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.0 |
| Published | 2017-12-02 |
| First published | 2017-12-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Daniel Levett |
| Maintainers | dlevs |
| Keywords | typeof, type, check |

## Links

- npm: https://www.npmjs.com/package/better-typeof
- Repository: https://github.com/dlevs/better-typeof
- Homepage: https://github.com/dlevs/better-typeof#readme
- Issues: https://github.com/dlevs/better-typeof/issues
- npm.io page: https://npm.io/package/better-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

- 2.0.0 (latest) — 2017-12-02
- 1.0.0 — 2017-12-01

## README

## What
`better-typeof` is a single JavaScript function that returns the type of a value. This is mainly a learning exercise. You should probably use [kind-of](https://www.npmjs.com/package/kind-of) instead.


## Why
The native JavaScript `typeof` operator is drunk and will shout `"object"` at almost any value you give it.
```javascript
typeof {}; // object
typeof /a/; // object
typeof null; // object
typeof []; // object
typeof new String('foo'); // object
```

## Installation
```bash
npm install --save better-typeof
```

## Usage
```javascript
const betterTypeof = require('better-typeof');

betterTypeof({}); // object
betterTypeof(/a/); // regexp
betterTypeof(null); // null
betterTypeof([]); // array
betterTypeof(new String('foo')); // string
```

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