joetjen.net
EN DE
← All libraries
JavaScript

node-dextrin

DXN for Node.js — .dxn text, .dxnb binary and .dxns schema documents, a sibling port of the Elixir reference implementation.

Intention

The DXN spec is implementation-independent, and a format is only worth adopting if it crosses language boundaries. This port stays close to the reference implementation’s shape-per-type choices wherever JavaScript allows, so recognizing one implementation gets you most of the way to the others.

Example
const { decode, encode, encodeBinary, decodeBinary } = require('@joetjen/dextrin');

const value = decode('%{x: 1, y: 2}');
encode(value);
// => '%{x:1,y:2}'

encode(decodeBinary(encodeBinary(value)));
// => '%{x:1,y:2}'
Install
npm install @joetjen/dextrin
Node.jsSerialization