How can I save a string to a text file with in-browser JavaScript?

25 Views Asked by At

I am new to javascript and I was wondering if you anyone can help me with this issue. I have the following string after using papa parse:

var csv_file = Papa.unparse({
                  "fields": ["Column 1", "Column 2"],
                  "data": [
                    ["foo", "bar"],
                    ["abc", "def"]
                  ]
                }); 

Now I'm trying to save the csv_file as a .csv file on my local machine (not downloading in the browser only saving it so I can see it in my directory) by giving it a specific name without using node.js. Is this possible?

Thank you.

0

There are 0 best solutions below