I am developing a single page app with Jquery. The user does some stuff on my app and I save some data in a JSON. Now I want to trasform the JSON in a text file and start the file download. How can I do this using only javascript, since I have no server side?
From what I understand, first step is encoding the JSON into base64:
// Encode the text
var text = btoa(JSON.stringify(json)));
//create the file???
//start the download??