Option 1.
Save the whole json encoded string.
Option 2
To convert this from a string to an object using JSON.parse, you will need double quotes.
Using the regular expression to add double quotes made here , we get the desired result:
attrs = ("{" + attrs + "}").replace(/([{,])(\s*)([A-Za-z0-9_\-]+?)\s*:/g,'$1"$3":');
var obj = JSON.parse(attrs);
UPD:
epascarello, , name: Jack, , , . , , - ,