tpl

command module
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

README

tpl

Simple templating from environment variables.

Usage

Given the following sample file (sample.txt):

Hello {{ .Env.USER }}
$ tpl sample.txt
Hello saghul

The output is always stdout. This utility is means to be used as follows:

$ tpl nginx.conf.tpl > nginx.conf

Template context

Templates use Golang text/template.

You can access environment variables within a template in the .Env object.

There are some built-in functions as well: sprout

More functions:

  • toBool
  • countRune
  • pipeline compatible regex functions from sprout
    • reReplaceAll
    • reReplaceAllLiteral
    • reSplit

Thanks

This project is a fork of frep with a more limited scope. Thank you Guoqiang Chen for creating frep!

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL