Skip to content

Instantly share code, notes, and snippets.

@watilde
Last active December 17, 2015 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save watilde/5667946 to your computer and use it in GitHub Desktop.
Save watilde/5667946 to your computer and use it in GitHub Desktop.
Image's base64
var fs = require('fs');
fs.readFile('image.png', function(err, data) {
if (err) throw err;
console.log(new Buffer(data).toString('base64'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment