All Projects → stdlib-js → Stdlib

stdlib-js / Stdlib

Licence: apache-2.0
✨ Standard library for JavaScript and Node.js. ✨

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects
c
50402 projects - #5 most used programming language
Makefile
30231 projects
python
139335 projects - #7 most used programming language
julia
2034 projects

Projects that are alternatives of or similar to Stdlib

Librmath.js
Javascript Pure Implementation of Statistical R "core" numerical libRmath.so
Stars: ✭ 425 (-84.54%)
Mutual labels:  statistics, math, mathematics, node-js, science, scientific-computing
math-stats
A small library that does the statistics for your numbers.
Stars: ✭ 18 (-99.35%)
Mutual labels:  statistics, mathematics, stats
SciCompforChemists
Scientific Computing for Chemists text for teaching basic computing skills to chemistry students using Python, Jupyter notebooks, and the SciPy stack. This text makes use of a variety of packages including NumPy, SciPy, matplotlib, pandas, seaborn, NMRglue, SymPy, scikit-image, and scikit-learn.
Stars: ✭ 65 (-97.64%)
Mutual labels:  science, scientific-computing, scientific
Stats
A well tested and comprehensive Golang statistics library package with no dependencies.
Stars: ✭ 2,196 (-20.12%)
Mutual labels:  statistics, math, stats
Computator.net
Computator.NET is a special kind of numerical software that is fast and easy to use but not worse than others feature-wise. It's features include: - Real and complex functions charts - Real and complex calculator - Real functions numerical calculations including different methods - Over 107 Elementary functions - Over 141 Special functions - Over 21 Matrix functions and operations - Scripting language with power to easy computations including matrices - You can declare your own custom functions with scripting language
Stars: ✭ 174 (-93.67%)
Mutual labels:  math, mathematics, scientific-computing
tukey
Mini stats toolkit for Clojure/Script
Stars: ✭ 17 (-99.38%)
Mutual labels:  math, mathematics, stats
Machine Learning Curriculum
Complete path for a beginner to become a Machine Learning Scientist!
Stars: ✭ 279 (-89.85%)
Mutual labels:  statistics, math, mathematics
Euler
The open-source computational framework for the Swift language
Stars: ✭ 37 (-98.65%)
Mutual labels:  statistics, math, mathematics
Casadi
CasADi is a symbolic framework for numeric optimization implementing automatic differentiation in forward and reverse modes on sparse matrix-valued computational graphs. It supports self-contained C-code generation and interfaces state-of-the-art codes such as SUNDIALS, IPOPT etc. It can be used from C++, Python or Matlab/Octave.
Stars: ✭ 714 (-74.03%)
Mutual labels:  library, mathematics, scientific-computing
Ruby Statistics
Ruby gem for some statistical operations without any statistical language dependency
Stars: ✭ 67 (-97.56%)
Mutual labels:  statistics, math, stats
Fermat.js
Mathematics and statistics library for TypeScript.
Stars: ✭ 74 (-97.31%)
Mutual labels:  statistics, math, mathematics
Math Engine
Mathematical expression parsing and calculation engine library. 数学表达式解析计算引擎库
Stars: ✭ 123 (-95.53%)
Mutual labels:  library, lib, math
Sage
Mirror of the Sage source tree -- please do not submit PRs here -- everything must be submitted via https://trac.sagemath.org/
Stars: ✭ 1,656 (-39.76%)
Mutual labels:  math, mathematics, science
Math Php
Powerful modern math library for PHP: Features descriptive statistics and regressions; Continuous and discrete probability distributions; Linear algebra with matrices and vectors, Numerical analysis; special mathematical functions; Algebra
Stars: ✭ 2,009 (-26.92%)
Mutual labels:  statistics, math, mathematics
Torchfunc
PyTorch functions and utilities to make your life easier
Stars: ✭ 177 (-93.56%)
Mutual labels:  utilities, utils
Ugm
Ubpa Graphics Mathematics
Stars: ✭ 178 (-93.52%)
Mutual labels:  math, mathematics
Collapse
Advanced and Fast Data Transformation in R
Stars: ✭ 184 (-93.31%)
Mutual labels:  statistics, scientific-computing
Holster
A place to keep useful golang functions and small libraries
Stars: ✭ 166 (-93.96%)
Mutual labels:  library, utilities
Kau
An extensive collection of Kotlin Android Utils
Stars: ✭ 182 (-93.38%)
Mutual labels:  library, utils
Scikit Posthocs
Multiple Pairwise Comparisons (Post Hoc) Tests in Python
Stars: ✭ 186 (-93.23%)
Mutual labels:  statistics, stats

stdlib (/ˈstændərd lɪb/ "standard lib") is a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing applications. The library provides a collection of robust, high performance libraries for mathematics, statistics, data processing, streams, and more and includes many of the utilities you would expect from a standard library.

This is the GitHub repository of stdlib source code and documentation. For help developing stdlib, see the development guide.

Resources

External Resources

Features


Installation

To accommodate various use cases, stdlib can be consumed in multiple ways. The preferred means of consumption depends on your individual use case. We've provided some user stories to help you identify the best approach. 😃

While this project's installation instructions defaults to using npm for package management, installation via other package managers, such as yarn, should be a matter of simply swapping out npm commands with those of the relevant package manager.

User Stories

  • I want to perform data analysis and/or data science related tasks in JavaScript and Node.js, similar to how I might use IPython, Julia, R, and/or MATLAB.

  • I am building a web application.

    • I plan on using Browserify, Webpack, and other bundlers for use in web browsers.

      • Install individual packages. Installing the entire project is likely unnecessary and will lead to slower installation times.
    • I would like to vendor a custom bundle containing various stdlib functionality.

    • I would like to include stdlib functionality by just using a script tag.

      • Install one of the pre-built UMD browser bundles or consume one of the pre-built bundles via a CDN, such as unpkg.
    • I am interested in using a substantial amount of functionality found in a top-level stdlib namespace and don't want to separately install hundreds of individual packages (e.g., if building an on-line calculator application and wanting all of stdlib's math functionality).

      • Install one or more top-level namespaces. Installing the entire project is likely unnecessary and will lead to slower installation times. Installing a top-level namespace is likely to mean installing functionality which will never be used; however, installing a top-level namespace is likely to be easier and less time-consuming than installing many individual packages separately.

        When bundling, installing a top-level namespace should not be a concern, as individual functionality can still be independently required/imported. Project installation times may, however, be somewhat slower.

  • I am building a Node.js server application.

    • I am interested in using various functionality found in stdlib.

      • Install individual packages. Installing the entire project is likely unnecessary and will lead to slower installation times.
    • I am interested in using a substantial amount of functionality found in a top-level stdlib namespace and don't want to separately install hundreds of individual packages.

      • Install one or more top-level namespaces. Installing the entire project is likely unnecessary and will lead to slower installation times. Installing a top-level namespace is likely to mean installing functionality which will never be used; however, installing a top-level namespace is likely to be easier and less time-consuming than installing many individual packages separately.
  • I am using Deno.

  • I would like to use stdlib functionality in an Observable notebook.

  • I want to hack at stdlib, possibly even creating customized builds to link to platform-specific native libraries (such as Intel's MKL or some other numerical library).

Complete Library

To install the entire project as a library or application dependency,

$ npm install @stdlib/stdlib

Once installed, stdlib packages can be individually required/imported to minimize load times and decrease bundle sizes. For example, to use require

var ndarray = require( '@stdlib/ndarray/ctor' );

var arr = ndarray( [ [ 1, 2 ], [ 3, 4 ] ] );
// returns <ndarray>

and to use import

import ndarray from '@stdlib/ndarray/ctor';

var arr = ndarray( [ [ 1, 2 ], [ 3, 4 ] ] );
// returns <ndarray>

Individual Packages

stdlib is designed to allow decomposition of the main project into individual packages which can be independently consumed. Accordingly, users of the project can avoid installing all project functionality and only install the exact functionality they need.

To install individual packages, replace forward slashes / after @stdlib/ with hyphens -. For example,

$ npm install @stdlib/ndarray-ctor

Once installed, individual packages can be required/imported. For example, to use require

var ndarray = require( '@stdlib/ndarray-ctor' );

var arr = ndarray( [ [ 1, 2 ], [ 3, 4 ] ] );
// returns <ndarray>

and to use import

import ndarray from '@stdlib/ndarray-ctor';

var arr = ndarray( [ [ 1, 2 ], [ 3, 4 ] ] );
// returns <ndarray>

Namespaces

stdlib is comprised of various top-level namespaces (i.e., collections of related functionality united by common themes). For example, to install all math functionality found in the top-level math namespace,

$ npm install @stdlib/math

Once installed, packages within a top-level namespace can be individually required/imported to minimize load times and decrease bundle sizes. For example, to use require

var sin = require( '@stdlib/math/base/special/sin' );

var v = sin( 3.14 );
// returns <number>

and to use import

import sin from '@stdlib/math/base/special/sin';

var v = sin( 3.14 );
// returns <number>

Note: installing nested namespaces found within top-level namespaces (e.g., math/base) is not supported. Consider installing individual packages or the relevant top-level namespace.

Command-line Utility

To install globally for use as a command-line utility and/or use the REPL,

$ npm install -g @stdlib/stdlib

which will expose the stdlib command. For example, to see available sub-commands

$ stdlib help

and to run the REPL

$ stdlib repl

Browser Bundles

For pre-built distributable UMD bundles for use in browser environments or as shared ("vendored") libraries in server environments, see the dist directory and associated guide.

As an example, to include a UMD bundle exposing lower-level special math functions in a webpage, we can first locally install the UMD bundle package using npm

$ npm install @stdlib/dist-math-base-special-flat

and then include the following <script> tag in our HTML document

<script type="text/javascript" src="/path/to/@stdlib/dist-math-base-special-flat/build/bundle.min.js"></script>

making sure to modify the script path based on the local installation directory.

If no recognized module system is present, one can access bundle contents in another <script> tag via the global scope.

<script type="text/javascript">
    // If no recognized module system present, exposed to global scope:
    var erf = stdlib_math_base_special_flat.erf;
    console.log( erf( 0.5 ) );
</script>

For more details and available bundles, see the dist directory and associated guide. The guide includes instructions for consuming via CDNs, such as unpkg.

Custom Bundles

To create a custom bundle based on project needs,

  1. follow the download, configuration, and installation instructions as described in the development guide.

  2. navigate to the local installation directory.

  3. run the following command to print help documentation for providing a list of stdlib package names to bundle

    $ NODE_PATH=./lib/node_modules node ./bin/cli bundle-pkg-list -- -h
  4. modify and run the above command with the list of packages to bundle

    $ NODE_PATH=./lib/node_modules node ./bin/cli bundle-pkg-list -- <pkg> <pkg> <pkg> ...

Upon generating a bundle, the bundle can be loaded via a <script> tag as described above for pre-built distributable UMD bundles.

System Library

To install as a system library (e.g., for the purposes of creating custom builds), follow the download, configuration, and installation instructions as described in the development guide.


Prerequisites

Installing and running stdlib for use in Node.js requires the following prerequisites:

  • Node.js: JavaScript runtime (version >= 0.10)
  • npm: package manager (version > 2.7.0; if Node < 1.0.0, version > 2.7.0 and < 4.0.0; if Node <= 10.x.x, version > 2.7.0 and < 6.0.0)

Most functionality in stdlib is implemented in JavaScript and no further prerequisites are required to use stdlib (i.e., you can safely avoid installing any additional prerequisites); however, some implementations try to capture performance benefits by using native bindings and/or WebAssembly. While not required to run stdlib, as every stdlib implementation has a JavaScript fallback, the following dependencies are required for building native add-ons, including linking to BLAS and LAPACK libraries:

  • GNU make: development utility and task runner
  • GNU bash: an sh-compatible shell
  • gcc & g++ or Clang: C/C++ compilation and linking (g++ version >= 4.8; clang version >= 3.5, Xcode version >=8.3.1 on OS X)
  • gfortran: Fortran compilation and linking (version >= 4.8)

While not required to run stdlib, the following dependencies are required for automatically downloading external libraries:

  • curl, wget, or fetch (FreeBSD): utilities for downloading remote resources

The following external libraries can be automatically downloaded and compiled from source using make:

  • OpenBLAS: optimized BLAS library
  • Electron: framework for cross-platform desktop applications

Contributing

First time contributor?

Already an expert?

  • Fork the repository.

  • Clone the forked repository

    $ git clone --depth=1 https://github.com/<username>/stdlib.git

    where <username> is your GitHub username.

  • Navigate to the stdlib directory

    $ cd stdlib
  • Install dependencies

    $ make install-node-modules
  • Initialize your stdlib development environment

    $ make init

License

See LICENSE.

Copyright

Copyright © 2016-2021. The Stdlib Authors.


Status

stability-experimental

Version

git tag NPM version Node.js version

Community

Chat

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].