Skip to content

itaylor/envreplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

envreplace

Searches through files and replaces references to environment variables with the value of the named environment variable.

I use this to replace environment variables in config files at Docker container startup.

Example

Given a file test.file:

My File with an ${env.ENV_VAR}

And a variable set in the shell:

export ENV_VAR='environment variable'

You could run:

envreplace test.file

And test.file would be changed to:

My File with an environment variable

Installation

npm install -g envreplace

Features:

  • Supports specifying your own format for the regular expression that finds env var matches
  • Allows use of node.js file globbing
  • Verbose mode that logs all replacements
  • Option to fail on missing variables

CLI Documentation

envreplace --help

About

CLI utility to find and replace environment variable references in files with their values

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published