My image src is base64 data as bellow:
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABd4AAAH ...." />
I want to save it as an image (like png format) by nodejs; how is it possible? I am using following code. The src is too big.and when I convert, the image is converted untill its half maybe.
var dt= "iVBORw0KGgoAAAANSUhEUgAABd4AAAH ...."
let buff = Buffer.from(dt, 'base64');
fs.writeFileSync('./myImage.png', buff);