data-view-byte-offset (1.0.1)

Published 2026-02-24 13:55:05 +00:00 by atheaadmin

Installation

registry=
npm install data-view-byte-offset@1.0.1
"data-view-byte-offset": "1.0.1"

About this package

data-view-byte-offset Version Badge

github actions coverage License Downloads

npm badge

Get the byteOffset 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.byteOffset has been deleted after this module has loaded.

Example

const dataViewByteOffset = require('data-view-byte-offset');
const assert = require('assert');

const ab = new ArrayBuffer(42);
const dv = new DataView(ab, 2);
assert.equal(dataViewByteOffset(dv), 2);

Tests

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

Dependencies

Dependencies

ID Version
call-bound ^1.0.2
es-errors ^1.3.0
is-data-view ^1.0.1

Development Dependencies

ID Version
@arethetypeswrong/cli ^0.17.1
@ljharb/eslint-config ^21.1.1
@ljharb/tsconfig ^0.2.2
@types/call-bind ^1.0.5
@types/es-value-fixtures ^1.4.4
@types/for-each ^0.3.3
@types/object-inspect ^1.13.0
@types/tape ^5.6.5
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

javascript ecmascript dataView data view byte offset byteOffset robust
Details
npm
2026-02-24 13:55:05 +00:00
0
Jordan Harband
MIT
latest
4.7 KiB
Assets (1)
Versions (1) View all
1.0.1 2026-02-24