(De) struct - Node Module
Posted by Dave Eddy on Jul 18 2012 - tags: techEasily unpack C Structs and binary buffers
I wrote destruct
to tackle the problem of unpacking binary buffers in Node easily.
Based off the unpack
function in Perl, and inspired by prustat
by Brendan Gregg, this module makes it simple to take a binary buffer object, and a
format string to unpack values. There were other modules that claimed to have the same functionality,
but most of them were too poorly documented with the source code almost unreadable, while the
others were overcomplicated and didn’t support a simple format string.
This module does not handle all data types, it has only been tested on SmartOS, and was built for making it easier to extend the proc Node module by @dshaw.
Check out the project page here https://github.com/bahamas10/node-destruct.git
Usage
Example
yields
Install
npm install destruct
License
MIT Licensed