π‘ Parser and Serializer for js objects
| ποΈ Library | @jaisocx/objdata |
π·οΈ ver.: 2.1.3 |
| π Updated | Winter 2026 | Tue Jan 20 06:28:29 CET 2026 |
| π Size | π Folder: 155 KB | π¦ Tarball: _ KB | π .js: 5 KB |
| β‘ JS Engine | π Browser: β yes | π§ Express: β yes | π₯οΈ Console: β no |
Parser and Serializer for js objects
const objdataFormattedBytebuf: Uint8Array = ObjData.serialize( someObjectOrArray );
const obj: any = ObjData.parse( objdataFormattedBytebuf );
This is just another try to implement a binary data format for objects and arrays.
The objdata format is not being parsed by chars comparisons, but like in the good old style packets prefixes fixed positions and lengths binary fields with numeric values kept.
Since the JSON format is hardly editable when a .json document is big, and the depth of the nested objects grows, then the usage of the visual tool to edit objects becomes a must, and contents preview can be done by viewing json text when serialized to JSON format, or visualized with a JSTree js browser tool. The JS object remains still the same.
For now just text and numeric values apply to Datatype field, and the unit is always zero.
However, when serializing on the serverside, the visualized JS object view in browser js tree tool, can have miniimages designed to every js object tree node, due to its datatype, and numeric value unit can result in ui view of a numeric value postfixed, like timestamp BigInt value, when a dev knew the timestamp precision, can be on the serverside serialized with unit field value NUMBER_TIMESTAMP = 594, UNIT_C_MICROSECOND = 31, and be more user friendly formatted, e.g. like 123_456_789_000_mc, or just to deliver info to a js code, how to multiply/divide it to use with js Date object in date.setTime( timestampPresicionMilliseconds );
This was just the basic example of the advantages of the extended datatypes constants values set in the object, serialized to objdata format.
I have an idea of a more extensive storage usage the same objdata format, however working with js object BigInt for all numeric values, and aligned each prefix field always 8 bytes long values ( 64 bits ). This will have a 40 bytes long prefix, more than 2 times long than this 20 bytes long prefix format here in this pack.
The reason why this package is published, but without this feature has been implemented: I still donβt have the idea, to keep the algorythm here the same without copy-paste to another Serializer .ts class, however to work with not very many if statements to checkout the action for the current format, since additional actions in a loop use more resources, however doing the same task.
Easily done in some time. This will be just an object with constant property names:
Have a nice day.
Elias, Software Architect of Jaisocx Company