resolve-env
v1.0.0
Published
Quickly resolve strings with environmental variables. That is, turn `'Hello $USER!'` into `Hello linus!`.
Downloads
330
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