Description
Hi there!!
I've just published a similar library, which allows using JS objects with ArrayBuffer
/SharedBuffer
backed data. I could not find yours until now (after publishing). My library is @3m1/binary-object (source code), which allows defining the schema like I do when I use C structs/C++ classes to read/write binary data to/from files: in an OOP way (using JS @decorators
).
Besides having an acceptable OOP interface, I've focused in performance. The current version is just 2-3 times slower than JS natural classes/objects and consumes 2-3 times more heap memory on instantiation (at least, when executing with Node 14).
I think both projects can benefit from sharing tools and tricks and, who knows, maybe some day create a merging project. But, for sure, I would appreciate any advice and or feedback you could give me about my project. I'm going to take yours and run some profiling to compare them ans spot possible enhancements.
It still have some important TODOs like:
- Allow padding arrays to be able to use
TypedArrays
instead of my hackyBinaryArray
- Take care of endianess
- Create dynamic arrays definition which may grow/decrease