code: function(s, nameOfString) {
    var config = {};
    if (typeof s !== 'undefined' && s.length !== 0) {
      try {
        config = JSON.parse(s);
      } catch (e) {
        throw nameOfString + ' must have valid JSON value (' + e.name+': ' + e.message + '), found: "' + s +'"';
      }
    }
    return config;
  }
docs: var getFromEnv = function(options) {  var config = {}; var envConfig = process.env.NODE_CONFIG;  if (typeof envConfig !== 'undefined') { try { config = JSON.parse(envConfig); } catch (e) { throw 'Environment variable NODE_CONFIG must have valid JSON value.'; } }  console.log('* getFromEnv(): config: '+ JSON.stringify(config,null,2)); return config; };