typed-array-buffer <sup>Version Badge</sup>

github actions coverage License Downloads

npm badge

Get the ArrayBuffer out of a TypedArray, robustly.

This will work in node <= 0.10 and < 0.11.4, where there's no prototype accessor, only a nonconfigurable own property. It will also work in modern engines where TypedArray.prototype.buffer has been deleted after this module has loaded.

Example

const typedArrayBuffer = require('typed-array-buffer');
const assert = require('assert');

const arr = new Uint8Array(0);
assert.equal(arr.buffer, typedArrayBuffer(arr));

Tests

Simply clone the repo, npm install, and run npm test

typed-array-buffer - Installation

To install typed-array-buffer via this registry, you'll need to install via the --registry parameter with your package manager.

n

NPM

npm install typed-array-buffer --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Yarn

yarn config set registry https://js.registry.sudovanilla.org
yarn install typed-array-buffer

Learn more about the config option.

PNPM

pnpm install typed-array-buffer --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Bun Logo

Bun

bun install typed-array-buffer --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Learn more about setting this up in your bunfig.toml configuration.


For Deno, add the following to your .npmrc file in your directory:

registry="https://js.registry.sudovanilla.org"

Then run the deno install command.

typed-array-buffer - Download

Download Tarball (v1.0.3)

Integrity sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==
SHASUM a72395450a4869ec033fd549371b47af3a2ee536
Tarball https://js.registry.sudovanilla.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz