available-typed-arrays
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
array-filter | 1.0.0 | 2.53 kB | MIT | prod |
The "available-typed-arrays" is a handy npm package in JavaScript used to return an array of Names of Typed Arrays that are accessible in the current runtime environment. This feature can be useful when you want to perform dynamic computations and decisions based on the Typed Arrays available in your environment.
Using "available-typed-arrays" in your JavaScript project is straightforward. First, you need to install the package using npm with the following command npm install available-typed-arrays
.
Once installed, you can then require it in your JavaScript file like this: var availableTypedArrays = require('available-typed-arrays');
.
Here's an example of how to use it in your code:
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());
In this code, we are asserting that the available Typed Arrays in our environment match the ones listed in the array.
As for the documentation for the "available-typed-arrays", it is presented directly in the project's README on its GitHub page, which can be accessed here. This documentation provides an overview of what the package does, how to install it, as well as an example of how to use it in your JavaScript project.