juttle-jsdp

0.3.0 • Public • Published

juttle-jsdp

Build Status

The implementation of the Juttle Streaming Data Protocol (JSDP) used by the components of Project Juttle to send data and metadata between the server (juttle-service) and client (juttle-client-library) components.

Getting started

Node.js

Note: momentjs is a peerDependency.

$ npm install juttle-jsdp
let JSDP = require('juttle-jsdp');
console.log(JSDP.serialize({time: new Date(2000)}));

Browser

Note: momentjs is expected as an external dependency so be sure its available globally.

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.11.1/moment.js"></script>
<script type="text/javascript" src="dist/juttle-jsdp.js">
 
JuttleJSDP.serialize({time: new Date(2000)});
</script> 

API

JSDP.serialize(value)

Serializes the given object to JSON.

JSDP.deserialize(data)

Deserializes the given JSON and returns an object that has "value equality" with original serialization target.

/juttle-jsdp/

    Package Sidebar

    Install

    npm i juttle-jsdp

    Weekly Downloads

    1

    Version

    0.3.0

    License

    Apache-2.0

    Last publish

    Collaborators

    • demmer
    • go-oleg