NodeJS module to work with buffers as with structures
Usage
Declaration
To describe the structure you should use this syntax:
const struct = ;const description = ;
Where type may be:
1.Scalar(int,float,double,char(n))
2.Another structure description
You can use built-in scalar types:
const struct = ;const types = ;const substruct = ;const description = ;
Assigning
Then you can use this description to allocate Buffer:
const Struct = ;const instance = description;
You can get Buffer of this instance using instance.buffer. To get access in JavaScript-readable format you should use instance.data:
instancedataname = 'Alice';instancedatainfofirst = 42;instancedatainfoarray7 = 0xABCDEF;
You can also use objects to set values(it behaves as Object.assign):
instancedatainfo = first: 77 second: 34 ;
In this example first will be set to 77, second to 34, array will not be changed.