json-joy icon indicating copy to clipboard operation
json-joy copied to clipboard

JSON CRDT, JSON CRDT Patch, JSON Patch+, JSON Predicate, JSON Pointer, JSON Expression, JSON Type

JSON Joy 🦄🌈

JSON utilities. Libraries for collaborative editing with OT and CRDT approaches. This package consists of multiple self-contained libraries:

  • json-binary — JSON serializer and parser with Uint8Array binary data support.
    • Documentation 🚀
  • json-brand — TypeScript branded type for JSON.
    • Documentation 🚀
  • json-clone — JSON deep cloning methods.
    • Documentation 🚀
  • json-expression — implementation of JSON Expression language.
    • Documentation 🚀
  • json-pack — Fastest MessagePack codec implementation in JavaScript.
  • json-equal — Fastest JSON deep equal implementations in JavaScript.
    • Documentation 🚀
    • Reference 🤖
  • json-patch — Implementation of JSON Patch+ mutation operations.
    • Documentation 🚀
      • JSON Patch
      • JSON Predicate
      • JSON Patch Extended
    • Reference 🤖
  • json-patch-ot — Implementation of Operational Transformations for JSON Patch+ operations.
  • json-crdt — CRDT implementation for JSON type.
  • json-crdt-patch — JSON type CRDT operation specification and implementation.
    • Documentation 🚀
    • Specification 🤔
    • Binary snapshot encoding 🧬
    • Reference 🤖
  • json-rx — Implementation of JSON-Rx protocol for server and browser.
  • binary-rx — Implementation of Binary-Rx protocol (a binary version of JSON-Rx).
  • json-pointer — utilities for locating data in a JSON document using JSON Pointer.
  • json-cli — CLI utilities and functional testing suites.
    • Documentation 🚀
      • json-pack CLI
      • json-unpack CLI
      • json-pointer CLI
      • json-patch CLI
      • json-pack-test CLI
      • json-pointer-test CLI
      • json-patch-test CLI
  • json-random — generate random JSON value.
    • Documentation 🚀
  • json-size — calculate the size of serialized JSON object.
    • Documentation 🚀
  • json-type — JSON schema builder.
    • Documentation 🚀
  • json-type-serializer — fast json-type JSON and MessagePack serializer code generators.
    • Documentation 🚀
  • json-type-validator — fast json-type schema validator.
    • Documentation 🚀
  • util
    • base64 — fast isomorphic configurable Base64 encoder.
      • Documentation 🚀

Usage

To reduce your browser-side bundle size import directly from the library you use.

import from 'json-joy/{lib,es2020,es6,esm}/<library>';

For example:

import {deepEqual} from 'json-joy/lib/json-equal`;

All libraries can be imported from one of the below folders:

  • lib — ES5 compiled CommonJS code.
  • es2020 — ES2020 compiled CommonJS code.
  • es6 — ES6 compiled CommonJS code.
  • esm — latest TypeScript compiler supported EcmaScript modules code.

Development

Run all tests locally:

yarn build
yarn test:all

Read more about testing in Testing README.

Use Angular-type semantic commit messages for commit messages. Those are used in determining the version bump of the library for the next release. Optional, you can use git-cz for that:

npx git-cz