# is-nan

> ES2015-compliant shim for Number.isNaN - the global isNaN returns false positives.

Latest version **1.3.2** (published 2020-12-24) · MIT license · 0 weekly downloads

> **Native alternative:** Number.isNaN — Use native JavaScript (Node 0.10.0+) (https://developer.mozilla.orgGlobal_Objects/Number/isNaN)

## Install

```sh
npm install is-nan
pnpm add is-nan
yarn add is-nan
bun add is-nan
```

## 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.3.2 |
| Published | 2020-12-24 |
| First published | 2014-01-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.4 |
| Dependencies | 2 |
| Unpacked size | 10.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jordan Harband |
| Maintainers | ljharb |
| Keywords | is, NaN, not a number, number, isNaN, ES6, ES2015, shim, polyfill, es-shim API |

## Links

- npm: https://www.npmjs.com/package/is-nan
- Repository: https://github.com/es-shims/is-nan
- Issues: https://github.com/es-shims/is-nan/issues
- Funding: https://github.com/sponsors/ljharb
- npm.io page: https://npm.io/package/is-nan

## Dependencies (2)

- [call-bind](https://npm.io/package/call-bind.md) ^1.0.0
- [define-properties](https://npm.io/package/define-properties.md) ^1.1.3

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.3.2 (latest) — 2020-12-24
- 1.3.1 — 2020-12-24
- 1.3.0 — 2019-12-15
- 1.2.1 — 2015-08-16
- 1.2.0 — 2015-08-16
- 1.1.0 — 2015-06-25
- 1.0.1 — 2014-07-05
- 0.0.0 — 2014-01-20

## README

# is-nan <sup>[![Version Badge][2]][1]</sup>

[![dependency status][5]][6]
[![dev dependency status][7]][8]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]

[![npm badge][11]][1]

ES2015-compliant shim for Number.isNaN - the global isNaN returns false positives.

This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [spec](http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan).

## Example

```js
Number.isNaN = require('is-nan');
var assert = require('assert');

assert.notOk(Number.isNaN(undefined));
assert.notOk(Number.isNaN(null));
assert.notOk(Number.isNaN(false));
assert.notOk(Number.isNaN(true));
assert.notOk(Number.isNaN(0));
assert.notOk(Number.isNaN(42));
assert.notOk(Number.isNaN(Infinity));
assert.notOk(Number.isNaN(-Infinity));
assert.notOk(Number.isNaN('foo'));
assert.notOk(Number.isNaN(function () {}));
assert.notOk(Number.isNaN([]));
assert.notOk(Number.isNaN({}));

assert.ok(Number.isNaN(NaN));
```

## Tests
Simply clone the repo, `npm install`, and run `npm test`

[1]: https://npmjs.org/package/is-nan
[2]: https://versionbadg.es/es-shims/is-nan.svg
[5]: https://david-dm.org/es-shims/is-nan.svg
[6]: https://david-dm.org/es-shims/is-nan
[7]: https://david-dm.org/es-shims/is-nan/dev-status.svg
[8]: https://david-dm.org/es-shims/is-nan#info=devDependencies
[11]: https://nodei.co/npm/is-nan.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/is-nan.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/is-nan.svg
[downloads-url]: https://npm-stat.com/charts.html?package=is-nan

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