Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matteofigus/string-to-template
ES6 template literals from strings
https://github.com/matteofigus/string-to-template
es6 javascript string template-literals
Last synced: 2 months ago
JSON representation
ES6 template literals from strings
- Host: GitHub
- URL: https://github.com/matteofigus/string-to-template
- Owner: matteofigus
- License: mit
- Created: 2017-02-15T14:02:50.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-19T04:04:26.000Z (over 6 years ago)
- Last Synced: 2024-10-01T08:18:06.307Z (3 months ago)
- Topics: es6, javascript, string, template-literals
- Language: JavaScript
- Size: 7.81 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
string-to-template [![Build Status](https://secure.travis-ci.org/matteofigus/string-to-template.png?branch=master)](http://travis-ci.org/matteofigus/string-to-template)
==================[![Greenkeeper badge](https://badges.greenkeeper.io/matteofigus/string-to-template.svg)](https://greenkeeper.io/)
ES6 template literal starting from a string. Common scenario when working from json config files.### Install
```js
npm i string-to-template --save
```### Usage
```js
const execute = require('string-to-template')const result = execute("hello ${name}", { name: 'John'})
const another = execute("extension is \"${filename.split('.')[1]}\"", { filename: 'hi.json' })
```### License
MIT