Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

dist

Distributable files.

This directory contains distributable files for use in browser environments or as shared ("vendored") libraries in server environments. Each distributable is a standalone UMD bundle which, if no recognized module system is present, will expose bundle contents to the global scope.

Usage

<script type="text/javascript" src="/path/to/<bundle>.js"></script>

where <bundle> corresponds to the desired bundle. For example, to include the main un-minified bundle exposing a flat namespace

<script type="text/javascript" src="/path/to/stdlib-flat.js"></script>

If no recognized module system is present, access bundle contents via the global scope. For example, assuming the flat namespace bundle sourced above,

<script type="text/javascript">
    // `stdlib` is a global variable...
    var erf = stdlib.base.erf;
    console.log( erf( 0.5 ) );
</script>

Notes

  • Bundles are one of two namespace types: flat or tree. A tree namespace is a nested object namespace which mirrors the project's layout (e.g., stdlib.math.base.special.erf. A flat namespace uses the global alias namespace, where each package has a unique alias (e.g., stdlib.base.erf). Which namespace is preferred depends on personal taste and application context.

  • Each minified bundle has a corresponding gzip-compressed bundle. The gzip compression level for each compressed bundle is 9, which is the highest (and most optimal) compression level. Deciding between uncompressed and compressed bundles depends on the application and whether compression is handled elsewhere in the application stack (e.g., nginx, CDN, et cetera).

  • While you are strongly encouraged to vendor bundles and host with a CDN/provider which can provide availability guarantees, especially for production applications, bundles are available via unpkg for quick demos, proof-of-concepts, and instructional material. For example,

    <script type="text/javascript" src="https://unpkg.com/@stdlib/stdlib/dist/stdlib-repl.min.js"></script>

    Please be mindful that unpkg is a free, best-effort service relying on donated infrastructure which does not provide any availability guarantees. Under no circumstances should you abuse or misuse the service. You have been warned.

  • If you intend on embedding a standalone bundle within another bundle, you may need to rename require calls within the standalone bundle before bundling in order to maintain scoped module resolution. For example, if you plan on using browserify to generate a bundle containing embedded bundles, browserify plugins exist to "de-require" those bundles prior to bundling.

Bundles

Main

The main bundles, stdlib-flat and stdlib-tree, contain all browser compatible packages except for

The excluded packages can significantly inflate bundle size, and, if desired, should be bundled and sourced separately.

<script type="text/javascript" src="/path/to/stdlib-flat.min.js"></script>
<script type="text/javascript">
    // If no recognized module system present, exposed to global scope:
    var erf = stdlib.base.erf;
    console.log( erf( 0.5 ) );
</script>
Bundle Statistics
stdlib-flat.js stdlib-flat.min.js stdlib-flat.min.js.gz
15.324 MB 2.753 MB 490.399 kB
stdlib-tree.js stdlib-tree.min.js stdlib-tree.min.js.gz
15.354 MB 2.774 MB 491.402 kB

Base Special Mathematical Functions

The specialized bundle, stdlib-math-base-special-flat, contains low-level special mathematical functions and exposes them as a flat namespace. These functions elide argument validation and error handling, so use these functions with care. Their use can be beneficial in performance sensitive contexts where argument types and formats are known and tested in advance.

<script type="text/javascript" src="/path/to/stdlib-math-base-special-flat.min.js"></script>
<script type="text/javascript">
    // If no recognized module system present, exposed to global scope:
    var erf = stdlib_math_base_special_flat.base.erf;
    console.log( erf( 0.5 ) );
</script>
Bundle Statistics
stdlib-math-base-special-flat.js stdlib-math-base-special-flat.min.js stdlib-math-base-special-flat.min.js.gz
1.663 MB 174.819 kB 65.084 kB

Base Statistical Distributions

The specialized bundle, stdlib-stats-base-dists-flat, contains low-level statistical distribution functions and exposes them as a flat namespace. These functions elide argument validation and error handling, so use these functions with care. Their use can be beneficial in performance sensitive contexts where argument types and formats are known and tested in advance.

<script type="text/javascript" src="/path/to/stdlib-stats-base-dists-flat.min.js"></script>
<script type="text/javascript">
    // If no recognized module system present, exposed to global scope:
    var pdf = stdlib_stats_base_dists.base.dists.normal.pdf;
    console.log( pdf( 0.5, 0.0, 1.0 ) );
</script>
Bundle Statistics
stdlib-stats-base-dists-flat.js stdlib-stats-base-dists-flat.min.js stdlib-stats-base-dists-flat.min.js.gz
3.32 MB 251.084 kB 69.28 kB

Iterators

The specialized bundle, stdlib-iter-flat, contains iterator utilities and exposes them as a flat namespace.

<script type="text/javascript" src="/path/to/stdlib-iter-flat.min.js"></script>
<script type="text/javascript">
    // If no recognized module system present, exposed to global scope:
    var iterErf = stdlib_iter_flat.iterErf;
</script>
Bundle Statistics
stdlib-iter-flat.js stdlib-iter-flat.min.js stdlib-iter-flat.min.js.gz
3.293 MB 392.927 kB 73.913 kB

Plot

The specialized bundle, stdlib-plot-flat, contains plot functionality and exposes this functionality as a flat namespace.

<script type="text/javascript" src="/path/to/stdlib-plot-flat.min.js"></script>
<script type="text/javascript">
    // If no recognized module system present, exposed to global scope:
    var plot = stdlib_plot_flat.plot;
    plt = plot();
</script>
Bundle Statistics
stdlib-plot-flat.js stdlib-plot-flat.min.js stdlib-plot-flat.min.js.gz
1.664 MB 315.186 kB 85.725 kB

Datasets

The dataset bundle, stdlib-datasets-tree, contains all datasets and exposes them as a tree namespace. Unless an application depends on these datasets, they should not be sourced, and, if needed, consider bundling only those datasets which are necessary.

<script type="text/javascript" src="/path/to/stdlib-datasets-tree.min.js"></script>
<script type="text/javascript">
    // If no recognized module system present, exposed to global scope:
    var datasets = stdlib_datasets.datasets;
    console.log( datasets.AFINN_111() );
</script>

The dataset bundle, stdlib-datasets-tree-exclude, contains all datasets, except those which have a dedicated bundle, and exposes them as a tree namespace. Unless an application depends on these datasets, they should not be sourced, and, if needed, consider bundling only those datasets which are necessary.

<script type="text/javascript" src="/path/to/stdlib-datasets-tree-exclude.min.js"></script>
<script type="text/javascript">
    // If no recognized module system present, exposed to global scope:
    var datasets = stdlib_datasets_exclude.datasets;
    console.log( datasets.AFINN_111() );
</script>

The dataset bundle, stdlib-datasets-cmudict, contains the CMU Pronouncing Dictionary.

<script type="text/javascript" src="/path/to/stdlib-datasets-cmudict.min.js"></script>
<script type="text/javascript">
    // If no recognized module system present, exposed to global scope:
    var dataset = stdlib_datasets_cmudict.CMUDICT;
    console.log( dataset() );
</script>

The dataset bundle, stdlib-datasets-emoji, contains emoji datasets.

<script type="text/javascript" src="/path/to/stdlib-datasets-emoji.min.js"></script>
<script type="text/javascript">
    // If no recognized module system present, exposed to global scope:
    var dataset = stdlib_datasets_emoji.EMOJI;
    console.log( dataset() );
</script>

The dataset bundle, stdlib-datasets-fivethirtyeight-ffq, contains FiveThirtyEight food frequency questionnaire response data.

<script type="text/javascript" src="/path/to/stdlib-datasets-fivethirtyeight-ffq.min.js"></script>
<script type="text/javascript">
    // If no recognized module system present, exposed to global scope:
    var dataset = stdlib_datasets_fivethirtyeight_ffq.FIVETHIRTYEIGHT_FFQ;
    console.log( dataset() );
</script>

The dataset bundle, stdlib-datasets-img, contains images.

<script type="text/javascript" src="/path/to/stdlib-datasets-img.min.js"></script>
<script type="text/javascript">
    // If no recognized module system present, exposed to global scope:
    var img = stdlib_datasets_img.IMG_ANCANTHUS_MOLLIS;
    console.log( img() );
</script>

The dataset bundle, stdlib-datasets-moby-dick, contains Moby Dick.

<script type="text/javascript" src="/path/to/stdlib-datasets-moby-dick.min.js"></script>
<script type="text/javascript">
    // If no recognized module system present, exposed to global scope:
    var dataset = stdlib_datasets_moby_dick.MOBY_DICK;
    console.log( dataset() );
</script>

The dataset bundle, stdlib-datasets-primes-100k, contains the first 100,000 prime numbers.

<script type="text/javascript" src="/path/to/stdlib-datasets-primes-100k.min.js"></script>
<script type="text/javascript">
    // If no recognized module system present, exposed to global scope:
    var dataset = stdlib_datasets_primes_100k.PRIMES_100K;
    console.log( dataset() );
</script>

The dataset bundle, stdlib-datasets-sotu, contains State of the Union (SOTU) addresses.

<script type="text/javascript" src="/path/to/stdlib-datasets-sotu.min.js"></script>
<script type="text/javascript">
    // If no recognized module system present, exposed to global scope:
    var dataset = stdlib_datasets_sotu.SOTU;
    console.log( dataset() );
</script>

The dataset bundle, stdlib-datasets-spam-assassin, contains Spam Assassin.

<script type="text/javascript" src="/path/to/stdlib-datasets-spam-assassin.min.js"></script>
<script type="text/javascript">
    // If no recognized module system present, exposed to global scope:
    var dataset = stdlib_datasets_spam_assassin.SPAM_ASSASSIN;
    console.log( dataset() );
</script>

The dataset bundle, stdlib-datasets-suthaharan-multi-hop-sensor-network, contains Suthaharan's multi-hop sensor network data.

<script type="text/javascript" src="/path/to/stdlib-datasets-suthaharan-multi-hop-sensor-network.min.js"></script>
<script type="text/javascript">
    // If no recognized module system present, exposed to global scope:
    var dataset = stdlib_datasets_suthaharan_multi_hop_sensor_network.SUTHAHARAN_MULTI_HOP_SENSOR_NETWORK;
    console.log( dataset() );
</script>

The dataset bundle, stdlib-datasets-suthaharan-single-hop-sensor-network, contains Suthaharan's single-hop sensor network data.

<script type="text/javascript" src="/path/to/stdlib-datasets-suthaharan-single-hop-sensor-network.min.js"></script>
<script type="text/javascript">
    // If no recognized module system present, exposed to global scope:
    var dataset = stdlib_datasets_suthaharan_single_hop_sensor_network.SUTHAHARAN_SINGLE_HOP_SENSOR_NETWORK;
    console.log( dataset() );
</script>
Bundle Statistics
stdlib-datasets-tree.min.js stdlib-datasets-tree.min.js.gz
64.706 MB 17.707 MB
stdlib-datasets-tree-exclude.min.js stdlib-datasets-tree-exclude.min.js.gz
2.223 MB 320.727 kB
stdlib-datasets-cmudict.min.js stdlib-datasets-cmudict.min.js.gz
4.212 MB 924.726 kB
stdlib-datasets-emoji.min.js stdlib-datasets-emoji.min.js.gz
1.593 MB 162.868 kB
stdlib-datasets-fivethirtyeight-ffq.min.js stdlib-datasets-fivethirtyeight-ffq.min.js.gz
1.59 MB 186.602 kB
stdlib-datasets-img.min.js stdlib-datasets-img.min.js.gz
3.779 MB 2.795 MB
stdlib-datasets-moby-dick.min.js stdlib-datasets-moby-dick.min.js.gz
1.343 MB 507.598 kB
stdlib-datasets-primes-100k.min.js stdlib-datasets-primes-100k.min.js.gz
718.137 kB 244.505 kB
stdlib-datasets-sotu.min.js stdlib-datasets-sotu.min.js.gz
10.891 MB 3.598 MB
stdlib-datasets-spam-assassin.min.js stdlib-datasets-spam-assassin.min.js.gz
35.695 MB 8.906 MB
stdlib-datasets-suthaharan-multi-hop-sensor-network.min.js stdlib-datasets-suthaharan-multi-hop-sensor-network.min.js.gz
1.717 MB 115.176 kB
stdlib-datasets-suthaharan-single-hop-sensor-network.min.js stdlib-datasets-suthaharan-single-hop-sensor-network.min.js.gz
1.731 MB 113.493 kB

REPL

The REPL bundle, stdlib-repl, contains all browser compatible packages exposed via the project REPL and exposes a single function which attaches exports to a provided context.

<script type="text/javascript" src="/path/to/stdlib-repl.min.js"></script>
<script type="text/javascript">
    // If no recognized module system present, exposed to global scope:
    var repl = stdlib_repl.repl;

    // Extend the `window` context with REPL contents:
    repl( window );

    // Print the help docs:
    help( base.erf );
</script>
Bundle Statistics
stdlib-repl.min.js stdlib-repl.min.js.gz
74.967 MB 18.753 MB

Help

The help bundle, stdlib-flat-help, contains help texts for packages exposed in the flat namespace and exposes a single function which returns help texts corresponding to namespace aliases. While already included in the REPL bundle, this bundle is exposed separately in the event that one wants to independently consume help texts in other contexts.

<script type="text/javascript" src="/path/to/stdlib-flat-help.min.js"></script>
<script type="text/javascript">
    // If no recognized module system present, exposed to global scope:
    var help = stdlib_flat_help.help;

    // Print the help docs:
    console.log( help( 'base.sin' ) );
</script>
stdlib-flat-help.min.js stdlib-flat-help.min.js.gz
5.103 MB 360.943 kB