Encode and decode data to string using mustache-like template strings
npm install reversible-template-stringStringEncode a template with the given variables.
NOTE: values must not include curly braces or commas.
ObjectDecode a template string given the given template.
StringKind: global function
Returns: String - The template with the values encoded. E.g. 'employee_12_months_growth'
| Param | Type | Description |
| --- | --- | --- |
| template | String | Template string. E.g. 'employee_{period}_months_growth' |
| values | String | Object of values to insert in the string. E.g. { period: 12 } |
ObjectKind: global function
Returns: Object - An object given the matched template values. E.g. { period: '12' }
| Param | Type | Description |
| --- | --- | --- |
| template | String | Template string. E.g. 'employee_{period}_months_growth' |
| string | String | A string to be decoded with the given template. E.g. 'employee_12_months_growth' |