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, the variable to be encoded

Return result:

  • Buffer, Return 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, Return the decoded variable