
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
arraybuffer.prototype.slice
Advanced tools
An ES spec-compliant ArrayBuffer.prototype.slice shim. Invoke its "shim" method to shim ArrayBuffer.prototype.slice if it is unavailable.
This package implements the es-shim API interface. It works in an ES5-supported environment and complies with the spec.
Most common usage:
var assert = require('assert');
var slice = require('arraybuffer.prototype.slice');
var ab = new ArrayBuffer(1);
var arr = new Uint8Array(ab);
arr[0] = 123;
var ab2 = slice(ab);
var arr2 = new Uint8Array(ab2);
arr2[0] = 234;
assert.deepEqual(arr, new Uint8Array([123]));
assert.deepEqual(arr2, new Uint8Array([234]));
if (!ArrayBuffer.prototype.transfer) {
slice.shim();
}
var ab2 = ab.slice();
var arr2 = new Uint8Array(ab2);
arr2[0] = 234;
assert.deepEqual(arr, new Uint8Array([123]));
assert.deepEqual(arr2, new Uint8Array([234]));
Simply clone the repo, npm install, and run npm test
v1.0.0 - 2023-07-09
The buffer package is a Node.js core module that provides a way of handling binary data. It includes a Buffer.slice method that is similar to ArrayBuffer.prototype.slice, but it is specifically designed for Node.js Buffers, which are used for handling binary data in Node.js. While arraybuffer.prototype.slice is a polyfill for ArrayBuffer slicing, buffer is a more comprehensive solution for binary data manipulation in Node.js.
The typedarray package is a polyfill for JavaScript's typed array functionality, which includes support for ArrayBuffer and various typed array views. It provides a broader range of features compared to arraybuffer.prototype.slice, as it covers the entire typed array API, not just the slice method. This makes it suitable for environments that lack full typed array support.
FAQs
ES spec-compliant shim for ArrayBuffer.prototype.slice
The npm package arraybuffer.prototype.slice receives a total of 32,502,380 weekly downloads. As such, arraybuffer.prototype.slice popularity was classified as popular.
We found that arraybuffer.prototype.slice demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.