Module basic module

Module msgpack

msgpack encoding and decoding module

Reference method:

1 2
var encoding = require('encoding'); var msgpack = encoding.msgpack;

or

1
var msgpack = require('msgpack');

Static function

encode

Encode variables in msgpack format

1
static Buffer msgpack.encode(Value data);

Call parameters:

  • data : Value, variable to be encoded

Return result:

  • Buffer , returns the encoded binary data

decode

Decode the string into a variable in msgpack mode

1
static Value msgpack.decode(Buffer data);

Call parameters:

  • data : Buffer , the binary data to be decoded

Return result:

  • Value , returns the decoded variable