/json-joy

json-joy — JSON CRDT, JSON CRDT Patch, JSON Patch, JSON Predicate, JSON Patch Extended, JSON Patch+ OT, MessagePack codec, JSON-Rx, JSON-RPC 2.0, JSON Pointer, Reactive-RPC, random JSON generator, JSON Brand, JSON Expression, JSON Size, JSON Type, JSON Schema, JSON deep equality, JSON Binary, JSON clone, JSON utilities

Primary LanguageTypeScriptOtherNOASSERTION



json-joy - JSON tools for real-time and collaborative apps

json-joy

json-joy is dedicated to implementing cutting-edge real-time and collaborative editing algorithms. Currently, our focus is on developing the JSON CRDT protocol, a Conflict-free Replicated Data Type that enables seamless merging of changes in JSON data models, avoiding conflicts between replicas.

Additionally, json-joy offers a collection of practical JSON utilities. These utilities are designed as stand-alone mini-libraries, allowing you to leverage them independently for your specific needs:

  • json-binary — JSON serializer and parser with Uint8Array binary data support.
  • json-brand — TypeScript branded type for JSON.
  • json-clone — JSON deep cloning methods.
  • json-expression — implementation of JSON Expression language.
  • json-pack — Fastest CBOR, MessagePack, and UBJSON codecs in JavaScript.
  • json-equal — Fastest JSON deep equal implementations in JavaScript.
  • json-patch — Implementation of JSON Patch+ mutation operations.
  • json-pointer — utilities for locating data in a JSON document using JSON Pointer.
  • json-cli — CLI utilities and functional testing suites.
  • json-random — generate random JSON value.
  • json-size — calculate the size of serialized JSON object.
  • json-type — JSON schema builder.
  • util
    • base64 — fast isomorphic configurable Base64 encoder.

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