A blog by Devendra Tewari
One particular mechanism I find lacking in JavaScript is an easy, reusable, way to parse binary data. I have leveraged custom attributes in the past in .NET. JavaScript does not provide custom attributes. One means of specifying the format of binary data is to use JSON. I tend to favor declarative mechanisms for writing reusable code.
I like it better when I can leverage open source code. Cross-pollination of ideas from other language communities can also provide interesting design ideas.
I found the following that I may use instead of writing my own parser
Read the blog post about it from its author.
Provides a neat syntax for parsing binary data, derived from Erlang’s bit syntax. I see examples for Node.js, I wonder if it works within the browser.
If you are looking for something similar for Ruby, you can take a look at BinData.