Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zhoukekestar/dynamic-template-string
dynamic template string
https://github.com/zhoukekestar/dynamic-template-string
dynamic
Last synced: about 5 hours ago
JSON representation
dynamic template string
- Host: GitHub
- URL: https://github.com/zhoukekestar/dynamic-template-string
- Owner: zhoukekestar
- License: mit
- Created: 2019-02-22T01:31:10.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-02-22T01:39:46.000Z (over 5 years ago)
- Last Synced: 2024-04-29T21:15:45.883Z (7 months ago)
- Topics: dynamic
- Language: JavaScript
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dynamic-template-string
Deeply inspired by [stackoverflow](https://stackoverflow.com/a/37217166/4992897).
## Demo
```js
const assert = require('assert');
const Template = require('../');var tpl = new Template('hello ${name}');
assert(tpl.fill({name: 'world'}) === 'hello world');
assert(tpl.fill({name: 'china'}) === 'hello china');
```