Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
The typedarray package provides a polyfill for TypedArray functionality that is available in modern browsers. It allows for the manipulation of binary data in a similar way to how it's done in native implementations.
Buffer creation
This feature allows for the creation of a buffer with a specified size. In this case, a Uint8Array with 1024 bytes is created.
var typedarray = require('typedarray');
var uint8 = new typedarray.Uint8Array(1024);
Buffer manipulation
This feature allows for the manipulation of the buffer's contents. Here, the first byte is set to 255 and the second byte to 0.
var typedarray = require('typedarray');
var buffer = new typedarray.Uint8Array(2);
buffer[0] = 255;
buffer[1] = 0;
Buffer slicing
This feature allows for the slicing of the buffer, creating a new view of the original buffer without copying the underlying memory. In this example, a slice from the second byte to the third byte is created.
var typedarray = require('typedarray');
var buffer = new typedarray.Uint8Array(4);
var slice = buffer.subarray(1, 3);
The 'buffer' package provides similar functionality for handling binary data in Node.js. It is a Node.js core module, so it's more commonly used and has a broader API than 'typedarray'.
TypedArray polyfill ripped from this module.
var Uint8Array = require('typedarray').Uint8Array;
var ua = new Uint8Array(5);
ua[1] = 256 + 55;
console.log(ua[1]);
output:
55
var TA = require('typedarray')
The TA
object has the following constructors:
With npm do:
npm install typedarray
To use this module in the browser, compile with browserify or download a UMD build from browserify CDN:
http://wzrd.in/standalone/typedarray@latest
MIT
v0.0.7 - 2022-10-12
2e83ef6
592fe17
c5a4998
auto-changelog
c77cc4a
5a874a6
funding
in package.json 5421bfb
npmignore
to autogenerate an npmignore file 85f441b
c7cee04
bd1ee94
tape
8aaa43b
safe-publish-latest
809caf9
aud
in posttest
c8f7ac5
FAQs
TypedArray polyfill for old browsers
The npm package typedarray receives a total of 14,223,173 weekly downloads. As such, typedarray popularity was classified as popular.
We found that typedarray demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.