ludocode / msgpack-tools

Command-line tools for converting between MessagePack and JSON / msgpack.org[UNIX Shell]
Other
258 stars 18 forks source link

Simple question - how to write to a file #12

Closed gcmartijn closed 4 years ago

gcmartijn commented 4 years ago

Hi,

How do you write the data to a file ?

I did try some things (trail and error)

function createMsgPack(jsonData) {
    let bl = encode(jsonData)

    if (decode(bl) !== jsonData) {
        console.log("Cannot encode to msgPack")
        return false
    }

   // write the encode data to a file.
   // fs.createWriteStream('file.mp')
}

Thanks !

gcmartijn commented 4 years ago

Oops wrong git repo haha ;)