2.0.3 • Published 4 years ago

jsoncram v2.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

jsoncram

Crams json into a smaller footprint and unpacks it.

GitHub license GitHub issues Twitter

Install

npm i -D jsoncram

Usage

const { compress, decompress } = require('jsoncram');

const json = {
    name: 'Sem Postma',
    age: 21
};

const schema = {
    type: "object",
    required: [
        "name",
        "age"
    ],
    properties: {
        name: {
            type: "string"
        },
        age: {
            type: "number"
        }
    }
};

const compressed = compress(json, schema);
const decompressed = decompress(compressed, schema);

if (
    json.name === decompressed.name
    && json.age === decompressed.age
) {
    console.log('Yeeeeey');
}
2.0.3

4 years ago

2.0.2

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago