{"repo":"link-society/gotempl","free":true,"listed":false,"github":"https://github.com/link-society/gotempl","clone":"git clone https://github.com/link-society/gotempl.git","description":"Generic templating tool with support of JSON, YAML and TOML data","language":"Go","stars":10,"topics":["template","json","yaml","toml","golang"],"license":null,"category":"saas-starters-boilerplates","readme_excerpt":"gotempl Small binary used to generate files from Go Templates, environment variables and data files. The following formats are supported: - JSON - YAML - TOML - ENV (environment variables in the form \"key=value\") Usage Example: Basic usage Let's create a file named greeting.template containing the following: Using gotempl , you can then render this file to: Example: Rendering JSON Let's create a file named sample.json containing the following: And a file named greeting.template containing the following: Using gotempl , you can then render those files to: Example: Rendering multiple files Let's create a file named greeting.yaml containing the following: Then a file sample.json containing the following: And finally, a file greeting.template containing the following: Using gotempl , you can then render those files to: Example: Reading template from stdin Using the previous sample.json file and gotempl , you can render it to: Example: Using Sprig gotempl supports Sprig functions: Example: Using local file functions gotempl supports read file functions such as names description - - isDir, osIsDir test if input path is a directory readDir, osReadDir returns input path files readFile, osReadFile returns input path file content walkDir, osWalkDir returns recursively input path files and directory content fileExists, osFileExists true if input file path exists Contributing To add a new supported format, you'll need to implement the following interface: The add your implementation to t","default_branch":null,"files":null,"tree":[],"storefront":"/r/link-society","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/link-society/gotempl/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."}