altjson

1.0.0 • Public • Published

AltJSON.js

Build Status

Browser Support

Javascript implementation of AltJSON encoding. AltJSON is an alternative encoding for JSON designed to be more efficient while maintaining the same data model. Use JSON as your regular interface but speed it up when available using AltJSON.

More information about AltJSON is available here.

Usage

AltJSON.js works in node and in the browser. However it requires the Encoding API which is not implemented in all environments. In node the polyfill will be installed as a dependency but for browsers such as chrome a polyfill can be used.

require(["altjson"], function(AltJSON) {
    // Load via AMD.
});
// OR
var AltJSON = require("altjson"); // In node.
// OR
AltJSON; // When just included in a webpage.
 
AltJSON.encode([1,2,3]) //=> Uint8Array([0xC3,1,2,3])
AltJSON.decode(new Uint8Array([0x81])) //=> true

Package Sidebar

Install

npm i altjson

Weekly Downloads

1

Version

1.0.0

License

zlib

Last publish

Collaborators

  • kevincox