resolve-env

Quickly resolve strings with environmental variables. That is, turn `'Hello $USER!'` into `Hello linus!`.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
resolve-env
001.0.07 years ago8 years agoMinified + gzip package size for resolve-env in KB

Readme

resolveEnv
Quickly resolve strings with environmental variables. That is, turn `'Hello $USER!' into Hello linus!`.

Installation

npm install --save resolve-env

Usage

var resolveEnv = require('resolve-env');

// Displaying current user
resolveEnv('Node is running as user: $USER');

// Get url to linked docker container
resolveEnv('mongodb://$DB_PORT_27017_TCP_ADDR:$DB_PORT_27017_TCP_PORT');

// Interpolate variable
resolveEnv('The kingdom of ${USER}topia!');

License

MIT