A browserify, Pure JS implementation of msgpack spec v5
A pure CoffeeScript implementation of Msgpack.
npm install purepack
Tested and works with browserify, so
it's useful for packing and unpacking structures on the browser-side. It also works
node processes. In either case, it finds the fastest buffer
objects at its disposal to give you the best performance possible.
Pack an object
obj. Return a
Options currently supported, off by default:
floats— Use floats rather than doubles when encoding. Useful when saving space
sort_keys- Sort the keys of maps on outputs, so that purepack output can be compared in hashes.
ext- An 'extensible-type' function.
no_str8- Don't use 8-bit string encodings, to maintain compatibility with older msgpacks.
Unpack a packed
Buffer buf. Throws errors if there were underruns, or bad encodings.
Currently support options are:
extensible-typefunction that given a
[type,buf]tuple, returns an object. Can throw an error if needs be.
no_ext- If no
extoption is given, we plug in a default, stupid-ish
extfunction. Supply this flag if you don't want that.
make setup make
make setup make make test
Testing will run a series of scripts on your machine using
node. It also will
ask you to visit a URL with whichever browsers you please to test
browserify and with your browser's buffer objects.