1.3.1 • Published 7 years ago

es6-template-render v1.3.1

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

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

License

MIT © Guillaume Vincent

1.3.1

7 years ago

1.3.0

7 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago