Socket
Socket
Sign inDemoInstall

jsonstat-utils

Package Overview
Dependencies
8
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jsonstat-utils

A library of high level functions built on top of the JSON-stat Javascript Toolkit (JJT)


Version published
Weekly downloads
23
increased by43.75%
Maintainers
1
Install size
174 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 04 Nov 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc