Skip to content

Instantly share code, notes, and snippets.

@troufster
Created January 4, 2011 19:51
Show Gist options
  • Select an option

  • Save troufster/765290 to your computer and use it in GitHub Desktop.

Select an option

Save troufster/765290 to your computer and use it in GitHub Desktop.
Dead simple buffering
//Buffering bison "packets" before websockets to remove overhead
var bison = require('./bison');
var o1 = { name : "sven", nested : { boolzor : true } };
var o2 = { name : "rolf" };
var buf = [];
buf.push(o1);
buf.push(o2);
var enc = bison.encode(buf);
console.log(enc);
var dec = bison.decode(enc);
console.log(dec);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment