txon

Serialization library for node and browser

Usage no npm install needed!

<script type="module">
  import txon from 'https://cdn.skypack.dev/txon';
</script>

README

TXON GitHub Build Status codecov

TXON, not a new serialization format, is also JSON, but the content is somewhat different from the result generated from native JSON, that makes it more expressive than the native JSON.

Why

  • Supports references, saves more space.
  • Supports circular structure, no more such error message: Uncaught TypeError: Converting circular structure to JSON.
  • Supports custom parsers to serialize/deserialize anything.

Currently supported by default:

  • anything JSON supported
  • Date
  • NaN and ±Infinity
  • ArrayBuffer and TypedArrays

Installation

npm install txon

Usage

Please refer to the unit test codes in /test/ directory.