Hi, I'm very new to nim, but was wondering how I would go about converting a msgpack file back to the JSON file which was packed. In python I was able to achieve this simply with
with open("filename", "rb") as in_file:
data = msgpack.unpack(in_file)
But i can't seem to get this working in nim
For reference I am using the package msgpack4nim. What i tried (forgive any stupidity) is this:
import streams, msgpack4nim, json
var fs = readFile("fileName")
var output: JsonNode
unpack(fs, output)
Any help is appreciated!Use toJsonNode and fromJsonNode to interact with stdlib's json module.
https://github.com/jangko/msgpack4nim/blob/master/tests/test_json.nim#L29-L56