stdlib logo
--- # stdlib > Standard library for JavaScript. Stdlib is a collection of robust, high performance libraries for numeric computing, streams, and more. This is the GitHub repository of stdlib source code and documentation. For stdlib development notes, see below. ## Development ### Prerequisites Developing and running stdlib __requires__ the following prerequisites: * [git][git]: version control * [GNU make][gnu-make]: development utility and task runner * [curl][curl], [wget][wget], or [fetch][fetch] (FreeBSD): utilities for downloading remote resources * [Node.js][node-js]: JavaScript runtime (version `>= 0.10`) * [npm][npm]: package manager (version `> 2.7.0`; if Node `< 1.0.0`, version `> 2.7.0` and `< 4.0.0`) While not required to run stdlib, the following dependencies may be required for testing, benchmarking, and general development: * [Julia][julia]: language for technical computing (version `>= 0.4`) * [R][r]: language for statistical computing (version `>= 3.0.0`) * [Python][python]: general purpose language (version `>= 2.7`) * [gcc & g++][gcc] or [clang][clang]: C/C++ compilation and linking (g++ version `>= 4.7`; clang version `>= 3.1`) * [pandoc][pandoc]: universal document converter The following vendor libraries can be automatically downloaded and compiled from source using `make`: * [Boost][boost]: portable C++ libraries ### Download To acquire the source code, clone the git repository. ``` bash $ git clone https://github.com/stdlib-js/stdlib ``` If you are behind a firewall, you may need to use the `https` protocol, rather than the `git` protocol. ``` bash $ git config --global url."https://".insteadOf git:// ``` ### Configuration Determine the absolute path of the `lib/node_modules` directory within the repository. For example, from the repository directory ``` bash $ echo $(pwd)/lib/node_modules /path/to/stdlib-js/stdlib/lib/node_modules ``` To allow development tools to resolve library packages, set the [`NODE_PATH`][node-path] environment variable by adding the following line to the platform-specific configuration file for configuring user environments (e.g., [`.bash_profile`][bash-profile], [`.profile`][bash-profile], [`.bashrc`][bash-profile], or some other variant). ``` text export NODE_PATH=/path/to/stdlib-js/stdlib/lib/node_modules ``` Once finished, you may need to reload the configuration file in existing shells. For example, in a bash shell, ``` bash $ source ~/.bash_profile ``` ### Installation To install development dependencies, ``` bash $ make install ``` To install vendor dependencies, ``` bash $ make install-deps ``` To initialize the development environment, ``` bash $ make init ``` ### Update If you have previously downloaded stdlib using `git clone`, you can update an existing source tree using `git pull`. ``` bash $ cd ./path/to/stdlib $ git pull ``` If you have initialized the development environment using `make init`, updating the source tree will trigger hooks to ensure all development dependencies are up-to-date. ### Organization The stdlib source code is organized as follows: ``` text bin executable binaries deps vendor dependencies docs top-level documentation etc configuration files examples top-level library examples lib library source code test top-level tests tools development utilities workshops workshops ``` ### Troubleshooting * Occasionally, new versions of external dependencies may cause conflicts with existing builds. Most of the time, running ``` bash $ make clean $ make install ``` will be enough to resolve these conflicts. Otherwise, remove the git repository, clone, and reinstall. ### Editors * This repository uses [EditorConfig][editorconfig] to maintain consistent coding styles between different editors and IDEs, including [browsers][editorconfig-chrome]. --- ## Contributing See the [contributing guidelines][contributing]. ## License See [LICENSE][license]. ## Copyright Copyright © 2016-2017. The Stdlib [Authors][authors]. --- ## Status [![stability-experimental][stability-image]][stability-url] #### Version [![git tag][tag-image]][tag-url] [![NPM version][npm-image]][npm-url] [![Node.js version][node-image]][node-url] #### Build | OS | Build (master) | Coverage (master) | Build (develop) | Coverage (develop) | | --- | --- | --- | --- | --- | | Linux/OS X | [![Linux/OS X build status (master)][build-image-master]][build-url-master] | [![coverage (master)][coverage-image-master]][coverage-url-master] | [![Linux/OS X build status (develop)][build-image-develop]][build-url-develop] | [![coverage (develop)][coverage-image-develop]][coverage-url-develop] | | Windows | [![Windows build status (master)][windows-build-image-master]][windows-build-url-master] | [![coverage (master)][coverage-image-master]][coverage-url-master] | [![Windows build status (develop)][windows-build-image-develop]][windows-build-url-develop] | [![coverage (develop)][coverage-image-develop]][coverage-url-develop] | #### Dependencies [![Dependencies][dependencies-image]][dependencies-url] [![DevDependencies][dev-dependencies-image]][dev-dependencies-url] #### Community [![Chat][chat-image]][chat-url]