# fast-isnumeric

> The fast way to check if a JS object is numeric

Latest version **1.1.4** (published 2020-04-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install fast-isnumeric
pnpm add fast-isnumeric
yarn add fast-isnumeric
bun add fast-isnumeric
```

## 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.1.4 |
| Published | 2020-04-06 |
| First published | 2015-11-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/fast-isnumeric) |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 9.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Author | Alex Johnson |
| Maintainers | alexcjohnson, antrg, archmoj, bpostlethwaite, chriddyp, dmt0, emmanuelle, etpinard, jmmease, jody_plotly, nicolaskruchten, verazabeida, xhlu |
| Keywords | number, numeric, isnumeric, fast |

## Links

- npm: https://www.npmjs.com/package/fast-isnumeric
- Repository: https://github.com/plotly/fast-isnumeric
- Homepage: https://github.com/plotly/fast-isnumeric#readme
- Issues: https://github.com/plotly/fast-isnumeric/issues
- npm.io page: https://npm.io/package/fast-isnumeric

## Dependencies (1)

- [is-string-blank](https://npm.io/package/is-string-blank.md) ^1.0.1

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 1.1.4 (latest) — 2020-04-06
- 1.1.3 — 2019-06-09
- 1.1.2 — 2018-10-26
- 1.1.1 — 2015-11-05
- 1.1.0 — 2015-11-05
- 1.0.0 — 2015-11-05

## README

# fast-isnumeric

The fast way to check if a JS object is numeric

### Install

```
npm install fast-isnumeric
```

### API

```js
var isNumeric = require('fast-isnumeric');

isNumeric(/* any JS object */);
```

### How fast

Run comparison on jsperf: http://jsperf.com/isnumeric-jquery-and-alternate/5

![](http://i.imgur.com/dczrlVE.png)

### Warning

Please look up the test cases in
[test.js](https://github.com/plotly/fast-isnumeric/blob/master/test.js) before
using this module.

Most importantly, `fast-isnumeric` returns false on number and string
constructors. That is, `isNumeric(new Number(1))` and `isNumeric(new
String('1'))` are **false**.

### Tests

Test locally with karma:

```
npm test
```

### Why?

In [plotly](https://plotly.com/)'s javascript graphing library
[plotly.js](https://plotly.com/javascript/) numerical objects must be accounted
for in numerous hot code paths. Inspired by Jon Schlinkert's
[is-number](https://github.com/jonschlinkert/is-number), `fast-isnumeric` is
significantly simplified and sped up by ignoring number and string constructors.

### Author

Alex Johnson | https://github.com/alexcjohnson

### License

Copyright (c) 2015 Alex Johnson Released under the MIT license.

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