envtemplate
A simple template processor that replaces environment variables in files.
Usage
SITE_NAME="Site name" KEYWORDS="keyword1 keyword2" OTHER_VARIABLE="3123" npx envtemplate config.toml.template config.toml
The package will replace all occurrences of ${VARIABLE_NAME}
in the template file with the corresponding environment variable value.
Example
Template file (config.toml.template
):
site_name = "${SITE_NAME}"
keywords = "${KEYWORDS}"
other_variable = "${OTHER_VARIABLE}"
After running the command, the output file (config.toml
) will contain:
site_name = "Site name"
keywords = "keyword1 keyword2"
other_variable = "3123"
License
ISC