binobject
Easy way to encode / decode JavaScript objects in binary format with support for Date, ArrayBuffer and Node.js Buffer.
Installation
yarn add binobject
Usage
;; const sourceObject = users: name: 'Astrid' birthday: uniqueSignature: ;const buffer = ; assert;
Custom types
Both encoder and decoder class give you the possibility to define custom types for encoding and decoding. All you have to do is create a processor to decode and encode your custom type and then define a value. When defining a custom type it's important not to override a default type, you can check a full list starting from here. Also you need to be aware that currently this library support only up to 255 types (custom types included). See an example bellow:
;;; ;; deepEqualbinaryObject.decodebuffer, ;
More examples
Need more examples? Check out our test.ts file