function getEffectiveNodeEnv(options = {}) {
  if (options.node_env) {
    options.debug && debug(
      `operating in "${options.node_env}" environment (set by \`options.node_env\`)`
    );
    return options.node_env;
  }

  if (process.env.NODE_ENV) {
    options.debug && debug(
      `operating in "${process.env.NODE_ENV}" environment (as per \`process.env.NODE_ENV\`)`
    );
    return process.env.NODE_ENV;
  }

  if (options.default_node_env) {
    options.debug && debug(
      `operating in "${options.default_node_env}" environment (taken from \`options.default_node_env\`)`
    );
    return options.default_node_env;
  }

  options.debug && debug(
    'operating in "no environment" mode (no environment-related options are set)'
  );
  return undefined;
}
Returns effective (computed) `node_env`.

@param {object} [options]
@param {string} [options.node_env]
@param {string} [options.default_node_env]
@param {boolean} [options.debug]
@return {string|undefined} node_env