npm

Join us for the upcoming webinar, "Enterprise JavaScript done right: the tools you love, the security you need."Sign up here »

jsonstat-utils

2.5.2 • Public • Published

JSON-stat Javascript Utilities Suite (JJUS)

JJUS is a set of high level functions.

It can be run on the server as a Node.js module. Type the following command to install:

npm install jsonstat-utils

The module has all the functionality of the client version except tbrowser().

The module's functionality is also available in the command line (install the JSON-stat Command Line Conversion Tools).

JJUS can also be run on a browser as a library and as an ECMAScript module.

To include the JJUS library in your webpage, download the latest versions of json-stat.js (JJT) and json-stat.utils.js (JJUS). All but JJUS from functions are built on top of the JSON-stat Javascript Toolkit (JJT).

In your webpage, link to your own copies of the json-stat.js and json-stat.utils.js files:

<script src="/your-js-dir/json-stat.js"></script>
<script src="/your-js-dir/json-stat.utils.js"></script>

They are also available from several CDNs (jsDelivr, unpkg):

<script src="https://cdn.jsdelivr.net/npm/jsonstat/json-stat.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jsonstat-utils/json-stat.utils.js"></script>
<script src="https://unpkg.com/jsonstat/json-stat.js"></script>
<script src="https://unpkg.com/jsonstat-utils/json-stat.utils.js"></script>

Or using a particular version:

<script src="https://cdn.jsdelivr.net/npm/jsonstat@0.13.8/json-stat.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jsonstat-utils@2.5.1/json-stat.utils.js"></script>
<script src="https://unpkg.com/jsonstat@0.13.8/json-stat.js"></script>
<script src="https://unpkg.com/jsonstat-utils@2.5.1/json-stat.utils.js"></script>

While the JJT library works on any browser, the JJUS library requires a modern one. If you need to support very old browsers, provide polyfills for forEach, Array.indexOf, trim, find, findIndex and reduce (querySelector, querySelectorAll also required for tbrowser()).

To import the JJUS ECMAScript module in your webpage, download the latest versions of export.js and utils/export.js and link to your own copy of the JJUS module:

<script type="module">
  //Asumming JJT export.js is at "/your-js-dir/"
  import * as JSONstatUtils from "/your-js-dir/utils/export.js";
 
  //Or importing only a particular function instead of the whole module:
  //import { fromSDMX } from "/your-js-dir/utils/export.js";
</script> 

Because the JJUS module requires the JJT module, you don't need to import JJT when you want to use JJT's JSONstat(). The JJUS module exposes JJT as JSONstatUtils.JSONstat:

<script type="module">
  import * as JSONstatUtils from "/your-js-dir/utils/export.js";
  let JSONstat=JSONstatUtils.JSONstat;
</script> 

Or

<script type="module">
  import * as JSONstatUtils from "/your-js-dir/utils/export.js";
  import { JSONstat } from "/your-js-dir/utils/export.js";
</script> 

The ECMAScript module is available from several CDNs (jsDelivr, unpkg):

<script type="module">
  import * as JSONstatUtils from "https://cdn.jsdelivr.net/npm/jsonstat@latest/utils/export.js";
</script> 
<script type="module">
  import * as JSONstatUtils from "https://unpkg.com/jsonstat/utils/export.js";
</script> 

Using these CDNs you cannot freely choose a version of JJUS: you can only pick a version of JJT (and you will get the JJUS version associated with it).

<script type="module">
  import * as JSONstatUtils from "https://cdn.jsdelivr.net/npm/jsonstat@0.13.8/utils/export.js";
  //You'll get JJUS 2.5.1
</script> 

The JJUS ECMAScript module works on any browser that support ECMAScript modules.

JJUS includes 7 functions:

In version 2.0.0, the JJUS interface was changed. The new interface is not backward compatible.

To check the JJUS version:

JSONstatUtils.version

install

npm i jsonstat-utils

Downloadsweekly downloads

40

version

2.5.2

license

Apache-2.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability