title: How to make JSON.parse promise? (or asynchronous)
body: <p>I am trying to make a function which returns result of JSON.parse. Following is example code:</p>
  
  <pre><code>function test(raw) {
   return JSON.parse(raw);
  }
  
  // assume I provide valid raw_input...
  console.log(test(raw_input));
  // expect json object but it says "undefined"...
  </code></pre>
  
  <p>I think I know why (please correct me if I am wrong). JSON.parse is not asynchronous... it returns its result when it is ready. And console.log doesn't wait for its result... more like console.log thinks it is done, so it says "undefined".</p>
  
  <p>Here is my question... how can you make JSON.parse promise? Or asynchronous? Like how can you make "return" in the function to wait result of JSON.parse?</p>
  
  <p>If you can provide simple promise codes... that would be really helpful. Thank you so much in advance. (I am open to bluebird js or async/await or etc...)</p>
  
  <h3>ADDING codes (more about raw)</h3>
  
  <p>In the function, I am reading json file, then JSON.parse it, then return the result. (source is the path to the json file)</p>
  
  <pre><code>function test(source) {
  fs.readFile(source, function (err, content) {
  return JSON.parse(content));
  });
  }
  console.log(test('test.json'));
  // it says
  // undefined
  </code></pre>
  
  <p>json file looks like this (test.json)</p>
  
  <pre><code>{
  "a": "apple",
  "b": "banana",
  "c": "cat"
  }
  </code></pre>