Project

msgpacker

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
This gem provides a executable ruby script that converts a JSON stream to MessagePack-ed one and the other way around.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0

Runtime

 Project Readme

MsgPacker: JSON ⬌ MessagePack

a rubygem which converts a JSON stream to MessagePack-ed one and vice versa. It contains an excutable script that reads STDIN and writes the converted stream to STDOUT.

Installation

Install this gem

gem install msgpacker

Then you now have a executable script named msgpacker.

Usage

Prepare a sample JSON file

$ echo '{"compact": true, "schema": 0}' > DATA.json 

And then execute the following to make it as MessagePack

$ cat DATA.json | msgpacker > DATA.mpac

Finally, you might also want to decode the MsgPack-ed file

$ cat DATA.mpac | msgpacker -d -n > DATA_decoded.json

If you give the -n option, it prints decoded json items with newline(\n) character appended.