Socket
Socket
Sign inDemoInstall

msgpack-js-v5-ng

Package Overview
Dependencies
3
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    msgpack-js-v5-ng

msgpack encoder and decoder in pure javascript based on creationix/msgpack-js updated to match the new v5 specification with string support.


Version published
Weekly downloads
2
Maintainers
1
Install size
62.7 kB
Created
Weekly downloads
 

Readme

Source

MSGPACK-JS-V5

Please see the original README.md from the source repository for more information.

This is a port of creationix/msgpack-js to support the new MsgPack v5 specification.

Please feel free to open issues/pull requests for support/discussion.

INSTALL

$ npm i msgpack-js-v5 --save

USAGE

var msgpack = require('msgpack-js-v5-ng');
var output = msgpack.decode(packed).value;

EXTENSION

Since there is no way to encode undefined inside the msgpack spec, an extension point is used for this purpose. Specifically, the fixext 1 type is used with all values being 0 to indicate undefined. On the wire, it requires 3 bytes and should looks like this:

0xd4 | 0x00 | 0x00

Where | is byte separator.

EXT / FIXEXT

Extensions are encoded/decoded to and from a simple 2-elements array tuple of the form [type, Buffer]. Where type is the msgpack extension type identifier and Buffer is the raw decoded value.

Special case for fixext 1 since it will always be 1-byte long a simple [type, value] is returned directly instead of wrapping it in node.js Buffer.

VERSIONING

This package will follows msgpack-js version for the time being. The version string will simply be appended with v5.

If and when this package diverges from the original, we can start our own versioning. Or this module could just be merged into the original msgpack-js module.

FAQs

Last updated on 24 Feb 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc