Socket
Book a DemoInstallSign in
Socket

envreplace

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

envreplace

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

1.1.3
latest
Source
npmnpm
Version published
Weekly downloads
88
35.38%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

replace

FAQs

Package last updated on 23 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.