1.0.1 • Published 7 years ago

vegeto v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

vegeto

NPM version NPM downloads Build Status donate

463 bytes simple template engine that works for Node.js and browser.

Install

npm i --save vegeto

CDN: https://unpkg.com/vegeto/dist/

Usage

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 }}.

API

vegeto(template, data, options)

template

Type: string Default: ''

Template string.

data

Type: Object Default: {}

options

delimiters

Type: Array Default: ['{{', '}}']

Change the expression interpolation delimiters.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

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