es6-template-render

library to render es6 template base on objects

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
es6-template-render
1511.3.17 years ago8 years agoMinified + gzip package size for es6-template-render in KB

Readme

Build Status
Es6-template-render
library to render es6 template base on objects

Requirements

node 4+

Install

npm install es6-template-render

Create resource

import render from 'es6-template-render';

render('/api/${param1}/${param2}/', {param1: 'foo', param2: 'bar'})
// Output:
// '/api/foo/bar/'

or ES5
var render = require('es6-template-render');

render('/api/${param1}/${param2}/', {param1: 'foo', param2: 'bar'})
// Output:
// '/api/foo/bar/'

Use objects instead of string

import render from 'es6-template-render';

render('Hey, ${user.name}', { user: {name: 'Andrea' }})
// Output:
// 'Hey, Andrea'

Contributors

Andrea Falzetti Gabriel

License

MIT © Guillaume Vincent