title: Node.js eval var json parse
body: <p>I'm trying to make a small parser which receives the json string and the path to get:</p>
  
  <pre><code>var args = process.argv;
  var jsonToBeParsed = args[2];
  var path = args[3];
  
  var result = JSON.parse(jsonToBeParsed);
  
  console.log(result);
  console.log(result.path);
  </code></pre>
  
  <p>I'm calling this with </p>
  
  <pre><code>node parser.js '{"asd":"123", "qwe":"312"}' 'asd'
  </code></pre>
  
  <p>It gives me <code>undefined</code></p>
  
  <p>I think it has to be done with some eval function but I don't have too much experience with node/JS.
  How can I resolve this?, I need to get the result from the command line.</p>
  
  <p>Edit: I'm expecting "123" in the second log. Thanks @Esailija, the question wasn't too clear ...</p>