to-base64

to-base64.

to-base64

Transform file from local or network to base64 string data

npm install to-base64
var toBase64 = require('to-base64');
 
toBase64('https://github.com/favicon.ico', function (result) {
  console.log(result.base64);
  console.log(result.contentType);
}, function (error) {
  console.log(error);
});
  • add fromFile support

MIT