Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
available-typed-arrays
Advanced tools
Returns an array of Typed Array names that are available in the current environment
The available-typed-arrays npm package provides a simple way to list all available typed array constructors in the current environment. This can be particularly useful for applications that need to work with binary data in a way that is compatible across different platforms and JavaScript environments. It helps in identifying which typed arrays are supported, allowing developers to write more adaptable and robust code.
Listing available typed arrays
This feature allows you to retrieve an array of strings representing the names of all available typed array constructors. The code sample demonstrates how to use the package to get the list of available typed arrays and then log them to the console.
const availableTypedArrays = require('available-typed-arrays');
const typedArrays = availableTypedArrays();
console.log(typedArrays);
The 'typedarray' package provides a polyfill for TypedArray functionality for older browsers that do not support the latest JavaScript standards. While 'available-typed-arrays' helps in identifying available typed arrays in the environment, 'typedarray' aims to fill the gap by providing the functionality itself when it's not natively available. This makes 'typedarray' more focused on compatibility and polyfilling, whereas 'available-typed-arrays' is more about detection and adaptability.
The 'buffer' package is a node.js library for binary data manipulation. It provides a way to work with binary data through a Buffer class, which is similar to the typed arrays in JavaScript. While 'buffer' is more about providing a comprehensive set of tools for binary data manipulation, 'available-typed-arrays' focuses on identifying which typed array constructors are available in the current environment. 'buffer' can be seen as complementary to 'available-typed-arrays' for applications that need both data manipulation and environment adaptability.
Returns an array of Typed Array names that are available in the current environment.
var availableTypedArrays = require('available-typed-arrays');
var assert = require('assert');
assert.deepStrictEqual(availableTypedArrays(), [
'Int8Array',
'Uint8Array',
'Uint8ClampedArray',
'Int16Array',
'Uint16Array',
'Int32Array',
'Uint32Array',
'Float32Array',
'Float64Array',
'BigInt64Array',
'BigUint64Array'
].sort());
Simply clone the repo, npm install
, and run npm test
v1.0.6 - 2024-01-31
1850353
npmignore
to autogenerate an npmignore file 5c7de12
fcfb0ea
d844945
eslint
, @ljharb/eslint-config
, array.prototype.every
, safe-publish-latest
, tape
a2be6f4
eslint
, @ljharb/eslint-config
, aud
, auto-changelog
, tape
b283a3e
0ad1f2d
@ljharb/eslint-config
, array.prototype.every
, aud
, tape
cd36e81
f696e5f
aud
, npmignore
, tape
bf20080
FAQs
Returns an array of Typed Array names that are available in the current environment
The npm package available-typed-arrays receives a total of 29,448,794 weekly downloads. As such, available-typed-arrays popularity was classified as popular.
We found that available-typed-arrays 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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.