0

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.

Nowfal
  • 93
  • 1
  • 1
  • 4

1 Answers1

0

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.

Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252