mirror-rhinstaller-node-cache/data-view-buffer
2026-08-27 18:32:54 +02:00
..
test b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
.eslintrc b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
.nycrc b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
CHANGELOG.md b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
index.d.ts b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
index.js b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
LICENSE b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
package.json b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
README.md b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00
tsconfig.json b5d41c3cb6b2ee0dc03ecae6cf35d5f0430bf24380e62b42976f73f3803dd76f package.json 2026-08-27 18:32:54 +02:00

data-view-buffer Version Badge

github actions coverage License Downloads

npm badge

Get the ArrayBuffer out of a DataView, 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 DataView.prototype.buffer has been deleted after this module has loaded.

Example

const dataViewBuffer = require('data-view-buffer');
const assert = require('assert');

const ab = new ArrayBuffer(0);
const dv = new DataView(ab);
assert.equal(dataViewBuffer(dv), ab);

Tests

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