https://github.com/creationix/msgpack-js-browser
A browser port of msgpack-js using DataView and ArrayBuffer.
https://github.com/creationix/msgpack-js-browser
Last synced: 10 months ago
JSON representation
A browser port of msgpack-js using DataView and ArrayBuffer.
- Host: GitHub
- URL: https://github.com/creationix/msgpack-js-browser
- Owner: creationix
- Created: 2012-07-17T22:06:33.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2017-09-05T19:31:57.000Z (almost 9 years ago)
- Last Synced: 2025-04-10T02:55:31.089Z (about 1 year ago)
- Language: JavaScript
- Size: 19.5 KB
- Stars: 95
- Watchers: 6
- Forks: 22
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# msgpack for the browser
[](http://travis-ci.org/creationix/msgpack-js-browser)
A handwritten msgpack encoder and decoder for Browsers
This is a browser port of https://github.com/creationix/msgpack-js
The original format can be found at
## Extension
I've extended the format a little to allow for encoding and decoding of `undefined`.
This required a new type code that is marked as "ext format".
This change means that using these new types will render your serialized data
incompatible with other messagepack implementations that don't have the same
extension.
I've added a type for `undefined` that works just like the `null` type.
undefined 11010100 0xd4
## Usage
``` javascript
require(['msgpack'], function (msgpack) {
var initial = {Hello: "World"};
var encoded = msgpack.encode(initial);
var decoded = msgpack.decode(encoded);
});
```