Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • npm
  • Socket score

Version published
Maintainers
1
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

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc