json template engine in node.js
<p>I have a json template like the following:</p>

<pre><code>[
  {
    "type":"foo",
    "config":"{config}"
  },
  {
    "type":"bar",
    "arrConfig":"{arrConfig}"
  }
]
</code></pre>

<p>While i have a backing model like:</p>

<pre><code>{
  "config": {
    "test1": "value1",
    "test2": "value2"
  },
  "arrConfig": [
    "test3": {
      "key1": "val1"
    },
    "test4": {
      "key1": "val1"
    }
  ]
}
</code></pre>

<p>I'm wondering if there are any node modules out there which will automatically take these two and transform the placeholders in the template. So the output would look like:</p>

<pre><code>[
  {
    "type":"foo",
    "config":{
      "test1": "value1",
      "test2": "value2"
    }
  },
  {
    "type":"bar",
    "arrConfig": [
      "test3": {
        "key1": "val1"
      },
      "test4": {
        "key1": "val1"
      }
    ]
  }
]
</code></pre>