Simple data packing/unpacking in NodeJS