npm

Need private packages and team management tools?Check out npm Orgs. »

jsonstat-utils

2.5.5 • 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"></script>
<script src="https://cdn.jsdelivr.net/npm/jsonstat-utils"></script>
<script src="https://unpkg.com/jsonstat"></script>
<script src="https://unpkg.com/jsonstat-utils"></script>

Or using a particular version in production:

<script src="https://cdn.jsdelivr.net/npm/jsonstat@0.13.13"></script>
<script src="https://cdn.jsdelivr.net/npm/jsonstat-utils@2.5.5"></script>
<script src="https://unpkg.com/jsonstat@0.13.13"></script>
<script src="https://unpkg.com/jsonstat-utils@2.5.5"></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.mjs and utils/export.mjs and link to your own copy of the JJUS module:

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

Or

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

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

<script type="module">
  import * as JSONstatUtils from "https://cdn.jsdelivr.net/npm/jsonstat-utils@2.5.5/export.mjs";
</script> 
<script type="module">
  import * as JSONstatUtils from "https://unpkg.com/jsonstat-utils@2.5.5/export.mjs";
</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

68

version

2.5.5

license

Apache-2.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability