{"size": 413, "ext": "js", "max_stars_repo_path": "example/bower_components/filetobase64/example/main.js", "max_stars_repo_name": "miguelmota/base64toblob", "max_stars_repo_stars_event_min_datetime": "2015-09-10T07:11:05.000Z", "max_stars_repo_stars_event_max_datetime": "2020-02-28T13:39:33.000Z", "max_issues_repo_path": "example/bower_components/filetobase64/example/main.js", "max_issues_repo_name": "miguelmota/base64toblob", "max_issues_repo_issues_event_min_datetime": "2015-06-08T19:07:10.000Z", "max_issues_repo_issues_event_max_datetime": "2015-06-10T13:28:17.000Z", "max_forks_repo_path": "example/bower_components/filetobase64/example/main.js", "max_forks_repo_name": "miguelmota/base64toblob", "max_forks_repo_forks_event_min_datetime": "2019-09-19T10:50:09.000Z", "max_forks_repo_forks_event_max_datetime": "2021-02-10T04:21:50.000Z"}
{"max_stars_count": 6, "max_issues_count": 1, "max_forks_count": 2, "avg_line_length": 21.7368421053, "max_line_length": 61, "alphanum_fraction": 0.6610169492}
var $ = document;

var fileInput = $.getElementById('file');
var output = $.getElementById('output');
var text = $.getElementById('text');

fileInput.onchange = function(e) {
  var file = e.currentTarget.files[0];

  fileToBase64(file, function(base64) {
    console.log(base64); // iVBORw0KGgoAAAANSUhEUgAAADY...

    text.value = base64;

    output.src = ['data:image/png;base64,', base64].join('');
  });

};
