New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@stdlib/array-uint16

Package Overview
Dependencies
Maintainers
4
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stdlib/array-uint16

Uint16Array.

0.1.0
Source
npm
Version published
Weekly downloads
386K
-3.96%
Maintainers
4
Weekly downloads
 
Created

What is @stdlib/array-uint16?

@stdlib/array-uint16 is a package that provides utilities for creating and manipulating unsigned 16-bit integer arrays. It is part of the larger @stdlib library, which offers a wide range of mathematical, statistical, and utility functions.

What are @stdlib/array-uint16's main functionalities?

Creating a Uint16Array

This feature allows you to create a new Uint16Array from an array of numbers. The resulting array will contain unsigned 16-bit integers.

const uint16Array = require('@stdlib/array-uint16');
const arr = uint16Array([1, 2, 3, 4]);
console.log(arr);

Accessing Elements

This feature allows you to access elements in the Uint16Array using standard array indexing.

const uint16Array = require('@stdlib/array-uint16');
const arr = uint16Array([1, 2, 3, 4]);
console.log(arr[0]); // 1
console.log(arr[1]); // 2

Setting Elements

This feature allows you to set elements in the Uint16Array using standard array indexing.

const uint16Array = require('@stdlib/array-uint16');
const arr = uint16Array([1, 2, 3, 4]);
arr[0] = 10;
console.log(arr); // Uint16Array [ 10, 2, 3, 4 ]

Typed Array Methods

This feature allows you to use standard TypedArray methods like subarray to manipulate the Uint16Array.

const uint16Array = require('@stdlib/array-uint16');
const arr = uint16Array([1, 2, 3, 4]);
const subArray = arr.subarray(1, 3);
console.log(subArray); // Uint16Array [ 2, 3 ]

Other packages similar to @stdlib/array-uint16

Keywords

stdlib

FAQs

Package last updated on 23 Sep 2023

Did you know?

Socket

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.

Install

Related posts