Skip to content

Bash-like environment variables substitution

License

Notifications You must be signed in to change notification settings

inventage/envsubst

Repository files navigation

envsubst

Bash-like environment variables substitution

 Main Workflow  npm version

Example

Let's say you have a file temp with the following content:

${BAR}
${FOO:-foo}

When you run BAR=baz npx --ignore-existing @inventage/envsubst temp, you will end up with the following content in temp:

baz
foo

and the following output:

Made 2 replacements:

┌──────┬─────────────┬───────┐
│ File │ Variable    │ Value │
├──────┼─────────────┼───────┤
│ temp │ ${BAR}      │ baz   │
├──────┼─────────────┼───────┤
│ temp │ ${FOO:-foo} │ foo   │
└──────┴─────────────┴───────┘