Skip to content

Instantly share code, notes, and snippets.

@tj
Created June 23, 2011 17:43
Show Gist options
  • Save tj/1043089 to your computer and use it in GitHub Desktop.
Save tj/1043089 to your computer and use it in GitHub Desktop.
idea for someone who wants to play with node-ctype
// construct an object
// that will work with
// node-ctype from a c struct string:
var struct = new Struct('struct { int8_t r, g, b; }');
var rgb = struct.parse(buf);
console.log(rgb.r, rgb.b, rgb.b);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment