0.1.0 • Published 11 years ago
strtpl v0.1.0
strpl
Really simple string templates. Matches object paths wrapped with {{}} in strings to object values.
var t = require('strtpl');
console.log(t('Hello {{world}}!', {world: 'world'}));
Also supports chains:
console.log(t('Hi, {{user.name}}', {user: {name: 'Steve'}}));
Array indices are not yet supported, so you can't do:
t('First user: {{users[0].name}}', {users: [{name: 'John'}]});
0.1.0
11 years ago