expandenv

Expand $ENVIRONMENT_VARIABLES in a string

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
expandenv
151.0.010 years ago10 years agoMinified + gzip package size for expandenv in KB

Readme

expandenv
Environment Variable injection for your strings

Installation

npm install --save expandenv

Usage

Expandenv takes a string and injects the environment variable for each $KEYWORD it finds. If none is available it will leave the $KEYWORD. It also allows you to pass in a hash that will override the process.env variables you specify.
var expandenv = require('expandenv')
  , dir = expandenv("$PWD") // "/the/current/directory/"
  , example = expandenv("Hi $PARENT how are you?", {PARENT: 'Mom'}) // "Hi Mom how are you?"


Made with ⚡️ by @taterbase