title: How to use json in handlebars with nodeJs expressJs
body: <p>I have a JSON data in dataList variable and I want to add this in custom handlebars helper as a parameter.</p>
  
  <pre><code>var dataList = [
    {
      "id": 1,
      "title": "Arrange meeting",
      "date": "Today 10:35 | By Admin",
      "completed": true
    },
  ];
  </code></pre>
  
  <p>Handlebars Custom helper</p>
  
  <pre><code>var Handlebar = require('handlebars');
  Handlebar.registerHelper('List', function(data, options){
    //console.log(data) //returns undefined 
    return options.fn(JSON.parse(data)); // gives error
  });
  </code></pre>
  
  <p>Custom Helper Rendering:</p>
  
  <pre><code>{{#List dataList}} 
    {{&gt; widgets/toDoList}}
  {{/List}}
  </code></pre>
  
  <p>It produce error</p>
  
  <blockquote>
    <p>SyntaxError: Unexpected token u in JSON at position 0</p>
  </blockquote>
  
  <p>Whereas, it is working with the static data</p>
  
  <pre><code>{{#List '[
    {
      "id": 1,
      "title": "Arrange meeting",
      "date": "Today 10:35 | By Admin",
      "completed": true
    },
  ]' }} 
    {{&gt; widgets/toDoList}}
  {{/List}}
  </code></pre>