I think you want to download a file with the json as content right?
FileSaver.js makes this easy: https://github.com/eligrey/FileSaver.js/
var json = "YOU JSON";
var blob = new Blob([json], {type:"application/json;charset=utf-8"});
FileSaver.saveAs(blob, "export.sjon");