{"repo":"gsandf/template-file","free":true,"listed":false,"github":"https://github.com/gsandf/template-file","clone":"git clone https://github.com/gsandf/template-file.git","description":"🔀 Replace {{ variables }} in all your files","language":"TypeScript","stars":38,"topics":["template","template-string","variables","configuration","tools"],"license":null,"category":"cli-tools","readme_excerpt":"template-file 🔀 Replace {{ variables }} in all your files Use variables to replace template strings in any type of file. This is both a runnable command-line application and JavaScript/TypeScript module. ✨ Some helpful features: - If you use a JavaScript file as the dataFile argument, whatever object the JS exports is used for replacement. - If the value of one of the keys is a function, the result of that function is used for replacement. - Deeply-nested keys can be used for replacements. Usage Arguments - data - Data file in JSON; used to replace variables in source files - sourceGlob - Files to process; see glob for syntax - destination - Destination directory where processed files go ℹ️ TIP: Remember to place quotes around your arguments (if they contain asterisks, question marks, etc.) to keep your shell from expanding globs before template-file gets to consume them. Examples Just handle one file: Compile all .abc files in src/ to build/ : Compile all HTML files in src/ to dist/ using the exported result of a JavaScript module: Templates This uses templates similar to mustache templates, but there are some differences. Anything between {{ and }} can be replaced with a value. Spacing doesn't matter. To render a list of items, you can use {{#example}} and {{/example}} . Empty lists and falsy values aren't rendered: If you have an array of primitive values instead of objects, you can use {{ this }} to refer to the current value: If a replacement is a function, it is called","default_branch":null,"files":null,"tree":[],"storefront":"/r/gsandf","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/gsandf/template-file/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}