When I run
JSON.parse(`{name: 'test'}`);
I get an error. I'm just trying to parse a string and return it as JSON.
That isn't valid JSON. Properties are named with double quotes and strings are in double quotes.
console.log(JSON.parse(`{"name": "test"}`));
You can read about JSON here: https://www.json.org/json-en.html
{"name": "test"}. Notice the double quotes in key and value