コード例 #1
0
ファイル: setup.js プロジェクト: zhentian-wan/nodejsvariables
// Check all custom variables are in the variables file
function check_variables() {
    const constants_to_check = [
      "NODE_ENV",
      "PORT",
      "DB_ADDRESS",
      "PW",
      "USER"
    ];
    let have_error = false;

    for (let value of constants_to_check) {
      if (!process.env[value]) {
        have_error = true;
        console.error(
          colors.bgRed.white(`${value} constant value missing from variables.env`)
        );
      }
    }
    if (have_error) {
      throw new Error("Missing Constant value in variables.env");
    }
  }
コード例 #2
0
ファイル: log.js プロジェクト: hisabimbola/countly-server
		error: function(args) {
			for (var i = 0; i < args.length; i++) {
				if (typeof args[i] === 'string') { args[i] = colors.bgRed.white(args[i].white); }
			}
		}