Skip to content

Latest commit

 

History

History
73 lines (45 loc) · 1.75 KB

README.md

File metadata and controls

73 lines (45 loc) · 1.75 KB

Build Files

UMD CommonJS ES Module
File listenable-data.umd.js listenable-data.cjs.js listenable-data.esm.js

Terms and import

UMD

UMD builds can be used directly in the browser via a <script> tag. The default file from jsDelivr CDN at https://www.jsdelivr.com/gh/elementumjs/listenable-data is the UMD build (listenable-data.umd.js).

  • index.html
    <script src="index.js"></script>
  • index.js
    // ...

    const data = new Data(source);

CommonJS

CommonJS builds are intended for use with older bundlers like browserify or webpack 1. The default file for these bundlers (pkg.main) is the CommonJS build (listenable-data.cjs.js).

  • index.html
    <script src="index.js"></script>
  • index.js
    const Data = require("elementum/listenable-data");

    // ...

    const data = new Data(source);

ES Module

ES Module builds are intended for use with modern bundlers like webpack 2 or rollup. The default file for these bundlers (pkg.module) is the ES Module build (listenable-data.esm.js).

  • index.html
    <script src="index.js" type="module"></script>
  • index.js
    import Data from "@elementumjs/listenable-data";

    // ...

    const data = new Data(source);

Download locally

Install via npm:

    npm install @elementumjs/listenable-data