You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
stdlib ([/ˈstændərd lɪb/][ipa-english] "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.
46
45
47
-
This is the TypeScript documentation for exported functions, methods, properties, classes, and variables. For help developing stdlib, see the [development guide][stdlib-development].
46
+
47
+
We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib.
48
+
49
+
stdlib ([/ˈstændərd lɪb/][ipa-english] "standard lib") is a standard library with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js. 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.
50
+
51
+
What sets stdlib apart is its fully decomposable architecture, which allows you to swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.
52
+
53
+
When you use stdlib, you can be confident that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code available.
54
+
55
+
Want to join us in bringing numerical computing to the web? **Start by starring the project.**:star2:
56
+
57
+
Explore this GitHub repository for stdlib's source code and documentation. For guidance on developing stdlib, refer to the [development guide][stdlib-development].
58
+
59
+
Thank you for being a part of our community! Your support is invaluable to us!
48
60
49
61
## Resources
50
62
@@ -57,8 +69,10 @@ This is the TypeScript documentation for exported functions, methods, properties
57
69
58
70
### External Resources
59
71
60
-
-[**Twitter**][stdlib-twitter]
61
-
-[**Gitter**][stdlib-gitter]
72
+
-[**Google Calendar**][stdlib-public-calendar]: calendar of public events, including [open office hours][stdlib-office-hours].
73
+
-[**Open Collective**][open-collective-stdlib]: financially support the project.
74
+
-[**Bluesky**][stdlib-bluesky]: follow us on social media.
75
+
-[**Gitter**][stdlib-gitter]: chat with project maintainers and other community members.
62
76
63
77
## Features
64
78
@@ -128,17 +142,23 @@ This is the TypeScript documentation for exported functions, methods, properties
- Every function is accompanied by [TypeScript][typescript] declaration files, ensuring type safety and facilitating intelligent code completion in IDEs.
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. 😃
155
+
To accommodate various use cases, stdlib can be used in multiple ways. The preferred method of use depends on your individual use case. We've provided some user stories to help you identify the best approach. 😃
136
156
137
-
While this project's installation instructions defaults to using [npm][npm] for package management, installation via other package managers, such as [yarn][yarn], should be a matter of simply swapping out [npm][npm] commands with those of the relevant package manager.
157
+
While this project's installation instructions default to using [npm][npm] for package management, installation via other package managers, such as [yarn][yarn], should be a matter of simply swapping out [npm][npm] commands with those of the relevant package manager.
138
158
139
159
### User Stories
140
160
141
-
- 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.
161
+
- I want to perform **data analysis** and **data science** tasks in JavaScript and Node.js, similar to how I might use Python, Julia, R, and MATLAB.
142
162
143
163
- Install the entire project as a [command-line utility](#install_command_line_utility).
144
164
@@ -154,31 +174,41 @@ While this project's installation instructions defaults to using [npm][npm] for
154
174
155
175
- I would like to include stdlib functionality by just using a `script` tag.
156
176
157
-
- Install one of the pre-built UMD [browser bundles](#install_browser_bundles) or consume one of the pre-built bundles via a CDN, such as [unpkg][unpkg].
177
+
- I would like to use ES Modules.
178
+
179
+
- Use an individual package's ES Module [build](#install_env_builds_esm).
180
+
181
+
- I would like to use a pre-built bundle (possibly via a CDN, such as [unpkg][unpkg] or [jsDelivr][jsdelivr]).
182
+
183
+
- Install (or consume via a CDN) an individual package's pre-built UMD [browser bundle](#install_env_builds_umd).
158
184
159
185
- 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).
160
186
161
187
- Install one or more top-level [namespaces](#install_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.
162
188
163
-
Concerning 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.
189
+
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.
164
190
165
191
- I am building a [Node.js][node-js]**server application**.
166
192
167
193
- I am interested in using various functionality found in stdlib.
168
194
169
195
- Install [individual packages](#install_individual_packages). Installing the entire project is likely unnecessary and will lead to slower installation times.
170
196
171
-
- 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.
197
+
- I would like to **vendor** stdlib functionality and avoid dependency trees.
- 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.
172
202
173
203
- Install one or more top-level [namespaces](#install_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.
174
204
175
205
- I am using **Deno**.
176
206
177
-
-Use [skypack][skypack] to import [individual packages](#install_individual_packages).
207
+
-Import [individual packages](#install_env_builds_deno) using pre-built Deno builds.
178
208
179
209
- I would like to use stdlib functionality in an [Observable][observable] notebook.
180
210
181
-
- Consume one of the pre-built [browser bundles](#install_browser_bundles) via a CDN, such as [unpkg][unpkg].
211
+
- Consume a pre-built [browser bundles](#install_env_builds_umd) via a CDN, such as [unpkg][unpkg] or [jsDelivr][jsdelivr].
182
212
183
213
- 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).
184
214
@@ -199,7 +229,7 @@ $ npm install @stdlib/stdlib
199
229
Once installed, stdlib packages can be individually required/imported to minimize load times and decrease bundle sizes. For example, to use `require`
200
230
201
231
```javascript
202
-
var ndarray =require( '@stdlib/ndarray/ctor' );
232
+
var ndarray =require( '@stdlib/ndarray/array' );
203
233
204
234
var arr =ndarray( [ [ 1, 2 ], [ 3, 4 ] ] );
205
235
// returns <ndarray>
@@ -210,7 +240,7 @@ and to use `import`
210
240
<!-- run-disable -->
211
241
212
242
```javascript
213
-
importndarrayfrom'@stdlib/ndarray/ctor';
243
+
importndarrayfrom'@stdlib/ndarray/array';
214
244
215
245
var arr =ndarray( [ [ 1, 2 ], [ 3, 4 ] ] );
216
246
// returns <ndarray>
@@ -227,13 +257,13 @@ To install individual packages, replace forward slashes `/` after `@stdlib/` wit
227
257
<!-- run-disable -->
228
258
229
259
```bash
230
-
$ npm install @stdlib/ndarray-ctor
260
+
$ npm install @stdlib/ndarray-array
231
261
```
232
262
233
263
Once installed, individual packages can be required/imported. For example, to use `require`
234
264
235
265
```javascript
236
-
var ndarray =require( '@stdlib/ndarray-ctor' );
266
+
var ndarray =require( '@stdlib/ndarray-array' );
237
267
238
268
var arr =ndarray( [ [ 1, 2 ], [ 3, 4 ] ] );
239
269
// returns <ndarray>
@@ -244,7 +274,7 @@ and to use `import`
244
274
<!-- run-disable -->
245
275
246
276
```javascript
247
-
importndarrayfrom'@stdlib/ndarray-ctor';
277
+
importndarrayfrom'@stdlib/ndarray-array';
248
278
249
279
var arr =ndarray( [ [ 1, 2 ], [ 3, 4 ] ] );
250
280
// returns <ndarray>
@@ -312,37 +342,95 @@ and to run the [REPL][@stdlib/repl]
312
342
$ stdlib repl
313
343
```
314
344
315
-
<aname="install_browser_bundles"></a>
345
+
<aname="install_env_builds"></a>
316
346
317
-
### Browser Bundles
347
+
### Environment Builds
318
348
319
-
For pre-built distributable UMD bundles for use in browser environments or as shared ("vendored") libraries in server environments, see the [`dist`][stdlib-bundles] directory and associated [guide][stdlib-bundles].
349
+
<aname="install_env_builds_esm"></a>
320
350
321
-
As an example, to include a UMD bundle exposing lower-level special [math functions][@stdlib/math/base/special] in a webpage, we can first locally install the UMD bundle package using [npm][npm]
351
+
#### ES Modules
322
352
323
-
```bash
324
-
$ npm install @stdlib/dist-math-base-special-flat
325
-
```
353
+
To use ES Modules via a `<script>` tag, use **ES Module builds** available in each package's repository via a dedicated `esm` branch (e.g., see the [`esm`][@stdlib/math-base-special-erf-esm] branch for [`@stdlib/math-base-special-erf`][@stdlib/math-base-special-erf-esm]). For example,
326
354
327
-
and then include the following `<script>` tag in our HTML document
console.log( 'x: %d, erf(x): %d', x[ i ], erf( x[ i ] ) );
366
+
}
367
+
</script>
331
368
```
332
369
333
-
making sure to modify the script path based on the local installation directory.
370
+
<aname="install_env_builds_deno"></a>
371
+
372
+
#### Deno
373
+
374
+
To use individual packages in Deno, use **Deno builds** available in each package's repository via a dedicated `deno` branch (e.g., see the [`deno`][@stdlib/ndarray-array-deno] branch for [`@stdlib/ndarray-array`][@stdlib/ndarray-array-deno]). For example,
If no recognized module system is present, one can access bundle contents in another `<script>` tag via the global scope.
385
+
386
+
<a name="install_env_builds_jquery"></a>
387
+
388
+
#### jQuery-like Bundle
389
+
390
+
For those wanting a jQuery-like bundle, one can use pre-built distributable UMD bundles for use in browser environments or as shared ("vendored") libraries in server environments available in each package's repository via a dedicated `umd` branch. See sections [UMD](#install_env_builds_umd) and [Node.js](#install_env_builds_nodejs) for more details.
391
+
392
+
<a name="install_env_builds_umd"></a>
393
+
394
+
#### UMD
395
+
396
+
To use UMD bundles either via a `<script>` tag or in [Observable][observable], use UMD **browser builds** available in each package's repository via a dedicated `umd`branch (e.g., see the [`umd`][@stdlib/math-base-special-erf-umd] branch for [`@stdlib/math-base-special-erf`][@stdlib/math-base-special-erf-umd]). For example,
// If no recognized module system present, exposed to global scope:
340
-
var erf =stdlib_math_base_special_flat.erf;
341
-
console.log( erf( 0.5 ) );
404
+
(function () {
405
+
406
+
var x = linspace( -10.0, 10.0, 100 );
407
+
408
+
for ( var i = 0; i < x.length; i++ ) {
409
+
console.log( 'x: %d, erf(x): %d', x[ i ], erf( x[ i ] ) );
410
+
}
411
+
412
+
})();
342
413
</script>
343
414
```
344
415
345
-
For more details and available bundles, see the [`dist`][stdlib-bundles] directory and associated [guide][stdlib-bundles]. The [guide][stdlib-bundles] includes instructions for consuming via CDNs, such as [unpkg][unpkg].
416
+
<a name="install_env_builds_nodejs"></a>
417
+
418
+
#### Node.js
419
+
420
+
To **vendor** stdlib functionality and avoid installing dependency trees, use UMD**server builds** available in each package's repository via a dedicated `umd` branch (e.g., see the [`umd`][@stdlib/math-base-special-erf-umd] branch for [`@stdlib/math-base-special-erf`][@stdlib/math-base-special-erf-umd]). For example,
421
+
422
+
<!-- run-disable -->
423
+
424
+
```javascript
425
+
var linspace = require( '/path/to/vendor/umd/@stdlib/array-base-linspace' );
426
+
var erf = require( '/path/to/vendor/umd/@stdlib/math-base-special-erf' );
427
+
428
+
var x = linspace( -10.0, 10.0, 100 );
429
+
430
+
for ( var i = 0; i < x.length; i++ ) {
431
+
console.log( 'x:%d, erf(x):%d', x[ i ], erf( x[ i ] ) );
432
+
}
433
+
```
346
434
347
435
<a name="install_custom_bundles"></a>
348
436
@@ -359,24 +447,29 @@ To create a custom bundle based on project needs,
0 commit comments