# is-typed-array

> Is this value a JS Typed Array? This module works cross-realm/iframe, does not depend on `instanceof` or mutable properties, and despite ES6 Symbol.toStringTag.

Latest version **1.1.15** (published 2024-12-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-typed-array
pnpm add is-typed-array
yarn add is-typed-array
bun add is-typed-array
```

## Health

**Score 45/100 (D)** — status: stable.

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

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.1.15 |
| Published | 2024-12-18 |
| First published | 2015-05-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 0.4 |
| Dependencies | 1 |
| Unpacked size | 21.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Jordan Harband |
| Maintainers | ljharb, alexandergugel |
| Keywords | array, TypedArray, typed array, is, typed, Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, ES6, toStringTag, Symbol.toStringTag, @@toStringTag |

## Links

- npm: https://www.npmjs.com/package/is-typed-array
- Repository: https://github.com/inspect-js/is-typed-array
- Homepage: https://github.com/inspect-js/is-typed-array#readme
- Issues: https://github.com/inspect-js/is-typed-array/issues
- Funding: https://github.com/sponsors/ljharb
- npm.io page: https://npm.io/package/is-typed-array

## Dependencies (1)

- [which-typed-array](https://npm.io/package/which-typed-array.md) ^1.1.16

## 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.1.15 (latest) — 2024-12-18
- 1.1.14 — 2024-12-17
- 1.1.13 — 2024-02-02
- 1.1.12 — 2023-07-18
- 1.1.11 — 2023-07-17
- 1.1.10 — 2022-11-02
- 1.1.9 — 2022-05-14
- 1.1.8 — 2021-08-31
- 1.1.7 — 2021-08-07
- 1.1.6 — 2021-08-05
- 1.1.5 — 2021-02-14
- 1.1.4 — 2020-12-05
- 1.1.3 — 2020-01-24
- 1.1.2 — 2020-01-21
- 1.1.1 — 2020-01-19
- … 6 more at https://npm.io/package/is-typed-array/versions

## README

# is-typed-array <sup>[![Version Badge][npm-version-svg]][package-url]</sup>

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

[![npm badge][npm-badge-png]][package-url]

Is this value a JS Typed Array? This module works cross-realm/iframe, does not depend on `instanceof` or mutable properties, and despite ES6 Symbol.toStringTag.

## Example

```js
var isTypedArray = require('is-typed-array');
var assert = require('assert');

assert.equal(false, isTypedArray(undefined));
assert.equal(false, isTypedArray(null));
assert.equal(false, isTypedArray(false));
assert.equal(false, isTypedArray(true));
assert.equal(false, isTypedArray([]));
assert.equal(false, isTypedArray({}));
assert.equal(false, isTypedArray(/a/g));
assert.equal(false, isTypedArray(new RegExp('a', 'g')));
assert.equal(false, isTypedArray(new Date()));
assert.equal(false, isTypedArray(42));
assert.equal(false, isTypedArray(NaN));
assert.equal(false, isTypedArray(Infinity));
assert.equal(false, isTypedArray(new Number(42)));
assert.equal(false, isTypedArray('foo'));
assert.equal(false, isTypedArray(Object('foo')));
assert.equal(false, isTypedArray(function () {}));
assert.equal(false, isTypedArray(function* () {}));
assert.equal(false, isTypedArray(x => x * x));
assert.equal(false, isTypedArray([]));

assert.ok(isTypedArray(new Int8Array()));
assert.ok(isTypedArray(new Uint8Array()));
assert.ok(isTypedArray(new Uint8ClampedArray()));
assert.ok(isTypedArray(new Int16Array()));
assert.ok(isTypedArray(new Uint16Array()));
assert.ok(isTypedArray(new Int32Array()));
assert.ok(isTypedArray(new Uint32Array()));
assert.ok(isTypedArray(new Float32Array()));
assert.ok(isTypedArray(new Float64Array()));
assert.ok(isTypedArray(new BigInt64Array()));
assert.ok(isTypedArray(new BigUint64Array()));
```

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

[package-url]: https://npmjs.org/package/is-typed-array
[npm-version-svg]: https://versionbadg.es/inspect-js/is-typed-array.svg
[deps-svg]: https://david-dm.org/inspect-js/is-typed-array.svg
[deps-url]: https://david-dm.org/inspect-js/is-typed-array
[dev-deps-svg]: https://david-dm.org/inspect-js/is-typed-array/dev-status.svg
[dev-deps-url]: https://david-dm.org/inspect-js/is-typed-array#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/is-typed-array.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/is-typed-array.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/is-typed-array.svg
[downloads-url]: https://npm-stat.com/charts.html?package=is-typed-array
[codecov-image]: https://codecov.io/gh/inspect-js/is-typed-array/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/inspect-js/is-typed-array/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-typed-array
[actions-url]: https://github.com/inspect-js/is-typed-array/actions

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