BML
Binary markup language
BML a powerful declarative and symmetrical parser and packer for binary data.
Instead of writing imperative code to parse a piece of data, you declaratively define a data structure that describes your data. And you can use it in one direction to parse data into Javascript objects, and in the other direction, to pack objects into binary data.
Installing / Getting started
NodeJS: Just use npm to install BML and you are set :)
npm install binary-markup --save
yarn add binary-markup
Example
First describe structure of binary data
const byte struct = ; // define composite typeconst rgb = ;// you can use previously defined type to describe more complex onesconst colorsType = ;
Now you can read and parse binary data
const fs = ;const parse = ; fs;
You can as well convert javascript object to binary data
const pack = ; console;
Features
TBD
Contributing
If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.
Links
- Project homepage: https://github.com/srg-kostyrko/BML
- Repository: https://github.com/srg-kostyrko/BML
- Issue tracker: https://github.com/srg-kostyrko/BML/issues
- In case of sensitive bugs like security vulnerabilities, please contact srg.kostyrko@gmail.com directly instead of using issue tracker. We value your effort to improve the security and privacy of this project!
- Related projects:
- jBinary: https://github.com/jDataView/jBinary - uses similiar concept of descrative type definitions, but no activity recently
- Construct: https://github.com/construct/construct - Python library, lots of ideas taken from it
Licensing
The code in this project is licensed under MIT license.