TrueVault BLOB to file in node

98 Views Asked by At

How do I convert/write BLOB objects returned from truevault to files in a nodejs server.

const data = (res.blob).toString('binary')
const buf = new Buffer(data)
fs.writeFileSync("out.js", buf)

When I run this I get [object Blob] in the out.js file.

1

There are 1 best solutions below

0
On BEST ANSWER

The TrueVault JS SDK doesn't currently support accessing blobs in that way from Node.js; the methods for reading the contents of blobs are intended for use in web applications. If you need to access the contents of blobs from your Node.js application, I recommend sending a feature request in their website.