463 bytes simple template engine that works for Node.js and browser.
npm i --save vegeto
CDN: https://unpkg.com/vegeto/dist/
const vegeto = require('vegeto')
vegeto('hello {{ name }}', {name: 'world'})
//=> hello world
vegeto('hello {{ name.toUpperCase().split('').join('-') }}', {name: 'world'})
//=> hello W-O-R-L-D
You can use any JavaScript expression in the template within delimiters {{
and }}
.
Type: string
Default: ''
Template string.
Type: Object
Default: {}
Type: Array
Default: ['{{', '}}']
Change the expression interpolation delimiters.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
vegeto © egoist, Released under the MIT License.
Authored and maintained by egoist with help from contributors (list).
egoistian.com · GitHub @egoist · Twitter @rem_rin_rin