strtpl

0.1.0 • Public • Published

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'}]});

Package Sidebar

Install

npm i strtpl

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • hkkoren