lazy currently uses handlebars as its templating language, as it was easy enough to get started with. However, in the effort to streamline things and remove external dependencies JavaScript – more specifically template string literals – should be used, making it easier for everybody to just create lazy snippets, without needing to learn how string manipulation works in handlebars.
More so, the configuration files .lazy-config.json should also be moved to javascript, again to make it simpler to represent conditionals and configuration (maybe even allow for templates to be inlined).
Ideally a template is "just" a function that receives options and outputs a string:
const myTemplate = (opts) => `export const ${opts.name.toUpperCase()} = ${opts.value};`;
lazy currently uses handlebars as its templating language, as it was easy enough to get started with. However, in the effort to streamline things and remove external dependencies JavaScript – more specifically template string literals – should be used, making it easier for everybody to just create lazy snippets, without needing to learn how string manipulation works in handlebars.
More so, the configuration files
.lazy-config.jsonshould also be moved to javascript, again to make it simpler to represent conditionals and configuration (maybe even allow for templates to be inlined).Ideally a template is "just" a function that receives options and outputs a string: