The code below shows how to provide a download link. For more information please look at the Blog or File api.
var blob = new Blob(['content'], {type: 'text/plain'});
var a = $('<a>download it</a>').appendTo('body');
a.attr('href', URL.createObjectURL(blob));