js-env-compile
Replaces special directives in your javascript files with environment variables
Example:
TEST_BOOL=trueTEST_NUMBER=5.12 TEST_OBJECT={hi:\'mom\'} TEST_STRING="'hello world'" ./bin/jsenv <test/fixtures/test.js
/* global $ENV */var num = $ENVTEST_NUMBER;var str = $ENVTEST_STRING;var bool = $ENVTEST_BOOL;var object = $ENVTEST_OBJECT;var missing = $ENVTEST_MISSING; console;
Output:
/* global $ENV */var num = 512;var str = 'hello world';var bool = true;var object = hi:'mom';var missing = null