object-substitute
Recursively performs substitution of object properties where the value is a string with a prefix in the form env:
. Environment variables are recognized automatically, but custom substitution families can also be defined.
Installation
npm install object-substitute
Usage
var substitute = ; var source = key1: 'env:SOME_VAR' key2: nested1: false nested2: 'user:name' key3: 4; processenvSOME_VAR = 'hello';var substitutes = user: requser; ;
Returns:
key1: 'hello' key2: nested1: false nested2: 'Bob' key3: 4
License
Licensed under the MIT license. See (http://opensource.org/licenses/MIT).