Corrode is a batteries-included library for reading binary data. It helps you converting that blob-mess into useable data.
$ npm install --save corrode
$ npm test
$ npm run docs$ open doc/index.html
corrode provides standard read-actions like uint8-uint64 for big & little endian, strings, buffers and control-structures like loops, skipping, etc. for your buffers and files. Additionally you can use assertions to always be sure, the data you parse corresponds to a specified format. The parsing is done not by a configuration-object, but by imperative code, allowing for far greater flexibility.
corrode is an abstraction on top of
TransformStream and as such is pipeable to but also provides functions for more simple usage.
This library is not only heavily inspired by dissolve, it in fact can be seen as a total rewrite with even more features. The code is written in ES7, fully documented and tested.
const Corrode = ;const parser = ;parser;
var stream = fs;stream;parser;
These are just some of the very basic operations supported by Corrode.
All examples can be found in the examples/-folder. Included:
npm i image-to-ascii tempand can be run with
node examples/id3 test.mp3.
If you'd like to include your own examples, just open a PR. I'm more than happy to not have to think about existing complex structured binary data to parse myself.
It solves most of the major shortcomings dissolve has:
Not yet included are additions like bignum-support for int64 and additional non-node-standard-encodings.
corrode is currently not tested for use in browsers.
The following dependencies are installed when installing corrode:
This library is issued under the MIT license.