msgpack-js

The msgpack protocol implemented in pure javascript.

  • Owner: creationix/msgpack-js
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

msgpack for JavaScript

node support

browser support

A handwritten msgpack encoder and decoder for Node.JS and modern browsers.

The original format can be found at http://wiki.msgpack.org/display/MSGPACK/Format+specification

Extension

I've extended the format a little to allow for encoding and decoding of undefined and Buffer instances.

This required three new type codes that were previously marked as "reserved".
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.

There are two new types for storing node Buffer instances. These work just
like "raw 16" and "raw 32" except they are node buffers instead of strings.

buffer 16  11011000  0xd8
buffer 32  11011001  0xd9

Also I've added a type for undefined that works just like the null type.

undefined  11000100  0xc4

Usage

var msgpack = require('msgpack-js');
var assert = require('assert');

var initial = {Hello: "World"};
var encoded = msgpack.encode(initial);
var decoded = msgpack.decode(encoded);

assert.deepEqual(initial, decoded);

Main metrics

Overview
Name With Ownercreationix/msgpack-js
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 1)
Platform
License:MIT License
所有者活动
Created At2010-12-11 11:33:46
Pushed At2018-03-05 16:57:01
Last Commit At2018-03-05 10:57:00
Release Count6
Last Release Name0.3.0 (Posted on )
First Release Name0.1.0 (Posted on )
用户参与
Stargazers Count254
Watchers Count9
Fork Count44
Commits Count52
Has Issues Enabled
Issues Count17
Issue Open Count13
Pull Requests Count6
Pull Requests Open Count1
Pull Requests Close Count0
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private