Created
October 4, 2020 05:27
-
-
Save LishuGupta652/7338f7757b8901f0d4ff2e9fb3c2aec5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const filename = 'data.json'; | |
const jsonStr = JSON.stringify(JsonExport); | |
let element = document.createElement('a'); | |
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(jsonStr)); | |
element.setAttribute('download', filename); | |
element.style.display = 'none'; | |
document.body.appendChild(element); | |
element.click(); | |
document.body.removeChild(element); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment