🚚🐝 Beesn
CLI utility for converting between JSON and BSON formats
Usage
Arguments:
-x enables JSON -> BSON (default is BSON -> JSON)
-i FILE, --input FILE name of input file, "-" for STDIN (default: "-")
-o FILE, --output FILE name of output file, "-" for STDOUT (default: "-")
--stream reading a file containing multiple items, wrapping array is added
-w, --overwrite allow overwriting output file
-d, --debug debug output
-v, --verbose print more info
-h, --help print help text
Examples
Read BSON, convert to JSON and print result:
$ beesn -i test-data/01.bson
Read JSON, convert to BSON and save to file:
$ beesn -x -i test-data/01.json -o my.bson$ beesn -i my.bson # print fresh BSON file
Dependencies
- NodeJS (at least v8)
Installation
npm
alone had some issues when installing package globally.
I recommend using yarn
.
$ sudo npm i -g yarn$ sudo yarn global add beesn
Stream mode
Can be used to read MongoDB dumps. Be warned - there is only limited error detection and error reporting.
$ beesn --stream -i test-data/02-mongo.bson