Module msgpack
msgpack encoding and decoding module
Reference method:
1
2var encoding = require('encoding');
var msgpack = encoding.msgpack;
or
1var msgpack = require('msgpack');
Static function
encode
Encode variables in msgpack format
1static 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
1static Value msgpack.decode(Buffer data);
Call parameters:
- data: Buffer, The binary data to be decoded
Return result:
- Value, Return the decoded variable