msgpack-cli
Converts JSON/YAML to MessagePack, and vice-versa.
Last updated 4 months ago by onnovalkering .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install msgpack-cli -g
SYNC missed versions from official npm registry.

MessagePack CLI

Install

You can install, globally is recommended, the CLI from the npm registry:

$ npm i -g msgpack-cli

Usage

After installation, the msgpack command can be used, outlined by msgpack --help, as follows:

Converts JSON/YAML to MessagePack, and vice-versa.

USAGE
  $ msgpack [INPUT]

OPTIONS
  -J, --json-out       convert MessagePack -> JSON
  -Y, --yaml-out       convert MessagePack -> YAML
  -h, --help           show CLI help
  -i, --indent=indent  number of indentation spaces to use
  -j, --json-in        convert JSON -> MessagePack
  -o, --output=output  write output to this file
  -v, --version        show CLI version
  -y, --yaml-in        convert YAML -> MessagePack

Note: MessagePack input is expected in Base64 encoding.

Examples

The msgpack command accepts input as arguments:

$ msgpack -j '{"message": "Hello, world!"}'
gadtZXNzYWdlrUhlbGxvLCB3b3JsZCE=

$ msgpack -J -i=2 gadtZXNzYWdlrUhlbGxvLCB3b3JsZCE=
{
  "message": "Hello, world!"
}

Or, msgpack can read input from, and write output to, a file:

$ msgpack -J -i=2 gadtZXNzYWdlrUhlbGxvLCB3b3JsZCE= -o file.json

$ msgpack -j file.json
gadtZXNzYWdlrUhlbGxvLCB3b3JsZCE=

It also accepts input via stdin, supporting the use of pipes:

$ msgpack -j '{"message": "Hello, world!"}' | msgpack -J -i=2
{
  "message": "Hello, world!"
}

Current Tags

  • 0.2.0                                ...           latest (4 months ago)

3 Versions

  • 0.2.0                                ...           4 months ago
  • 0.1.1                                ...           4 months ago
  • 0.1.0                                ...           4 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (5)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |