assemble-template
v1.0.0
Published
A little helper for tagged template functions
Downloads
6
Maintainers
Readme
Assemble-template
Assemble the string / value pieces a tagged template literal - function receives as params.
Install
$ npm install assemble-template
Usage
const assembleTemplate = require('assemble-template');
const dashify = (strings, ...values) => {
let str = assembleTemplate(strings, ...values);
return str.replace(/\s+/g, '-').toLowerCase();
};
const dashifyed = 'dashifyed';
dashify`this will be ${ dashifyed }`;
API
assembleTemplate(strings, ...values)
strings
Type: array
An array of string
..values
Type: string
A parameter list of values;
License
MIT © Tobias Herber