[Help] How to Turn a File into Blob binary data in ]nodejs

  node.js, question

Now that I have read the document as byte[], I don’t know what to do next.

The following function reads the file. after Node.js reads the file,dataIs in binaryBufferIt’s saved in a format,BlobThe format of data is also stored in binary form, so it can be said thatdataThat’s what the subject wants.Blob binary dataI don’t know if I have solved the problem of the subject.

var fs = require('fs')
 fs.readFile('/etc/passwd', function (err, data) {
 if (err) throw err
 Log ('isbuffer:' add buffer.isbuffer (data))//isbuffer: true
 console.log(data) // <Buffer 72 6f ... >