msgpack-js
msgpack encoder and decoder in pure node js
Last updated 12 years ago by creationix .
Repository · Original npm · Tarball · package.json
$ npm install msgpack-js 
SYNC missed versions from official npm registry.

msgpack for node

Build Status

A handwritten msgpack encoder and decoder for Node.JS.

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');
var assert = require('assert');

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

assert.deepEqual(initial, decoded);

Current Tags

  • 0.3.0                                ...           latest (11 years ago)

7 Versions

  • 0.3.0                                ...           11 years ago
  • 0.2.1                                ...           11 years ago
  • 0.2.0                                ...           11 years ago
  • 0.1.5                                ...           12 years ago
  • 0.1.4                                ...           12 years ago
  • 0.1.1                                ...           12 years ago
  • 0.1.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 6
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None

© 2010 - cnpmjs.org x YWFE | Home | YWFE