Socket
Book a DemoInstallSign in
Socket

@stdlib/stdlib

Package Overview
Dependencies
Maintainers
4
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stdlib/stdlib

Standard library.

0.3.2
latest
Source
npmnpm
Version published
Weekly downloads
60K
-61.23%
Maintainers
4
Weekly downloads
 
Created

What is @stdlib/stdlib?

@stdlib/stdlib is a comprehensive standard library for JavaScript and Node.js, providing a wide range of utilities for scientific computing, data analysis, and general-purpose programming.

What are @stdlib/stdlib's main functionalities?

Mathematical Functions

The package provides a variety of mathematical functions, such as trigonometric, exponential, and logarithmic functions. This example demonstrates the use of the sine function.

const stdlib = require('@stdlib/stdlib');
const sin = stdlib.math.base.special.sin;
console.log(sin(Math.PI / 2)); // 1

Statistical Functions

@stdlib/stdlib includes statistical functions for data analysis, such as mean, median, and standard deviation. This example calculates the mean of an array of numbers.

const stdlib = require('@stdlib/stdlib');
const mean = stdlib.stats.base.mean;
console.log(mean([1, 2, 3, 4, 5])); // 3

Random Number Generation

The package offers random number generation utilities, supporting various distributions. This example generates a random number between 0 and 1.

const stdlib = require('@stdlib/stdlib');
const randu = stdlib.random.base.randu;
console.log(randu()); // Random number between 0 and 1

Data Structures

@stdlib/stdlib provides data structures like arrays and matrices, which are essential for handling and manipulating data efficiently. This example shows how to create an array.

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

Other packages similar to @stdlib/stdlib

Keywords

stdlib

FAQs

Package last updated on 21 Dec 2024

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.