array-buffer-byte-length (1.0.2)
Published 2026-02-24 13:52:55 +00:00 by atheaadmin
Installation
registry=npm install array-buffer-byte-length@1.0.2"array-buffer-byte-length": "1.0.2"About this package
array-buffer-byte-length 
Get the byte length of an ArrayBuffer, even in engines without a .byteLength method.
Example
const assert = require('assert');
const byteLength = require('array-buffer-byte-length');
assert.equal(byteLength([]), NaN, 'an array is not an ArrayBuffer, yields NaN');
assert.equal(byteLength(new ArrayBuffer(0)), 0, 'ArrayBuffer of byteLength 0, yields 0');
Tests
Simply clone the repo, npm install, and run npm test
Dependencies
Dependencies
| ID | Version |
|---|---|
| call-bound | ^1.0.3 |
| is-array-buffer | ^3.0.5 |
Development Dependencies
| ID | Version |
|---|---|
| @arethetypeswrong/cli | ^0.17.1 |
| @ljharb/eslint-config | ^21.1.1 |
| @ljharb/tsconfig | ^0.2.2 |
| @types/es-value-fixtures | ^1.4.4 |
| @types/for-each | ^0.3.3 |
| @types/object-inspect | ^1.13.0 |
| @types/tape | ^5.8.0 |
| auto-changelog | ^2.5.0 |
| encoding | ^0.1.13 |
| es-value-fixtures | ^1.5.0 |
| eslint | =8.8.0 |
| evalmd | ^0.0.19 |
| for-each | ^0.3.3 |
| in-publish | ^2.0.1 |
| npmignore | ^0.3.1 |
| nyc | ^10.3.2 |
| object-inspect | ^1.13.3 |
| safe-publish-latest | ^2.0.0 |
| tape | ^5.9.0 |
| typescript | next |
Keywords
shim
polyfill
ArrayBuffer
byteLength
byte
length
es-shim API
es-shims
