How do I convert a png buffer to a jpg without writing to a file?
You can use https://github.com/aheckmann/gm
var gm = require('gm')
// convert a buffer to a stream
gm(buffer, 'img.png')
.stream('jpg')
.pipe(outputStream);
// convert a buffer to a buffer
gm(buffer, 'img.png')
.toBuffer('PNG',function (err, buffer) {
if (err) return handle(err);
console.log('done!');
})