Make an object from a string in node js
<p>I am sending the string from AngularJS to NodeJS in following form.</p>

<pre><code>"{↵obj:{↵one:string,↵two:integer↵}↵}"//request object from browser console
</code></pre>

<p>I want to convert this string in object and use its properties.for this the server side code is following:</p>

<pre><code>var data=req.body.data.replace(/"/g,"");
var str=data.replace(/\n/g," ");
//res.json(str) // returning "{ obj:{ one:string, two:integer } }"
try {
var obj=JSON.parse(JSON.stringify(str)).replace(/"/g,"");
res.json(obj);//returning same "{ obj:{ one:string, two:integer } }"
} catch (error) {
console.log(error);
}
</code></pre>

<p>I want to get <strong>['users']</strong> by  <strong>Object.keys[obj]</strong> or by any other method want to access the properties of this object.but failed to achieve this.</p>

<p>Many solutions like <a href="https://www.google.co.uk/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=4&amp;ved=0ahUKEwjykq6Jp77QAhUMKsAKHWxbC9kQFggxMAM&amp;url=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F14028259%2Fjson-response-parsing-in-javascript-to-get-key-value-pair&amp;usg=AFQjCNESEAp732pblpJUyvzUxSni4HAy7Q&amp;sig2=0VsjNNOKRAj2rF6SoAuAmQ&amp;bvm=bv.139782543,d.d2s&amp;cad=rja" rel="nofollow noreferrer">This</a> couldn't be helpful.any suggestion here??</p>