...Usually when you want to save a file generated with JavaScript, you have to send the data to your server and then return the data right back with a Content-disposition: attachment header. This is less than ideal for webapps that need to work offline. The W3C File API includes a FileSaver interface, which makes saving generated data as easy as saveAs(data, filename), though unfortunately it will eventually be removed from the spec. With FileSaver.js, which implements FileSaver in all modern browsers, it’s possible to generate any type of file you want right in the browser, document editors can have an instant save button that doesn’t rely on an online connection.