convert file to buffer nodejs code example
Example: write buffer to file in node
fs = require('fs');
fs.writeFile('helloworld.txt', 'Hello World!', function (err) {
if (err) return console.log(err);
console.log('Hello World > helloworld.txt');
});