Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jpbruinsslot/template
Use environment variables and .env files in Go templates.
https://github.com/jpbruinsslot/template
cli dotenv environment-variables go golang template templates
Last synced: 22 days ago
JSON representation
Use environment variables and .env files in Go templates.
- Host: GitHub
- URL: https://github.com/jpbruinsslot/template
- Owner: jpbruinsslot
- License: mit
- Created: 2015-05-14T13:51:44.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-04-07T09:03:14.000Z (over 1 year ago)
- Last Synced: 2024-06-21T03:02:28.011Z (5 months ago)
- Topics: cli, dotenv, environment-variables, go, golang, template, templates
- Language: Go
- Homepage:
- Size: 2.3 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Template
========Use environment variables in Go templates.
Installation
------------#### Binary installation
[Download](https://github.com/jpbruinsslot/template/releases) a
compatible binary for your system. For convenience, place `template` in a
directory where you can access it from the command line.#### Via Go:
```
$ go get -u github.com/jpbruinsslot/template
```Usage
-----#### Command line usage:
```
NAME:
template - use environment variables and data files (like .env) in Go templatesUSAGE:
template -t [template-file] -o [output-file] -d [data-file]EXAMPLES:
# Use system wide environment variables
$ template -t input.tpml -o output.txt
$ template -t input.tmpl > output.txt# Use data files (support for env and json files)
$ template -t input.tpml -o output.txt -d data.env
$ template -t input.tpml -o output.txt -d data.json# Use stdin for template file
$ cat input.tmpl | template -o output.txt # output txt file
$ cat input.tmpl | template -o - # output to stdout
$ cat input.tmpl | template # output to stdout# Use stdin for data file
$ cat data.env | template -t input.tmpl -o output.txt -d - # output txt file
$ cat data.env | template -t input.tmpl -d - # output to stdoutVERSION:
0.2.1WEBSITE:
https://github.com/jpbruinsslot/templateGLOBAL OPTIONS:
-t, -template [template-file] template file
-o, -output [output-file] output file
-d, -data [data-file] data file
-h, -help
```