node.js - How do I convert an image to a base64-encoded data URL code example
Example: node.js - How do I convert an image to a base64-encoded data URL
var fs = require('fs');
var imageAsBase64 = fs.readFileSync('./your-image.png', 'base64');
var fs = require('fs');
var imageAsBase64 = fs.readFileSync('./your-image.png', 'base64');