Takes a JS object template and a list of bindings to create an object with bindings replaced.
var instan = require('instantiator');
var template = { $a: '$x', $x: ['$y', '$z'], abc: 123 };
var bindings = { $a: 'hello', $x: 'world', $y: 'wide', $z: 'web' };
var obj = instan(template, bindings);
// Result: { hello: 'world', world: ['wide', 'web'], abc: 123 }Module provides a single function that has the following signature.
- template - template object. Should have
$varstrings in places that should be replaced. (can be keys or string values) - bindings - object with bindings that have the replace values for the
$varsin the template object.
