Is it possible to create an object from a string content?
For example, I have a string "{ name: John }"
how can I simply parse it to create an object { name: 'John' }
?
UPDATE
Unfortunately JSON.parse
won't work for me, there can be also some tricky strings (if you used mongodb you know), e.g. { name: John, email: { $exists: true } }
Maybe there is another solution like mongodb query parser?