constructor(options = {}) { super(options); this.emptyError = options.emptyError || 'No items were selected'; this.term = process.env.TERM_PROGRAM; if (!this.options.header) { let header = ['', '4 - Strongly Agree', '3 - Agree', '2 - Neutral', '1 - Disagree', '0 - Strongly Disagree', '']; header = header.map(ele => this.styles.muted(ele)); this.state.header = header.join('\n '); } }
constructor(options = {}) { super(); this.name = options.name; this.type = options.type; this.options = options; theme(this); timer(this); this.state = new State(this); this.initial = [options.initial, options.default].find(v => v != null); this.stdout = options.stdout || process.stdout; this.stdin = options.stdin || process.stdin; this.scale = options.scale || 1; this.term = this.options.term || process.env.TERM_PROGRAM; this.margin = margin(this.options.margin); this.setMaxListeners(0); setOptions(this); }
/** * Setup enviroment. */ let setupEnv = function (app: Application, args: {env: string}) { app.set(Constants.RESERVED.ENV, args.env || process.env.NODE_ENV || Constants.RESERVED.ENV_DEV, true); }
/** * Configure custom logger. */ let configLogger = function (app: Application) { if (process.env.POMELO_LOGGER !== 'off') { let env = app.get(Constants.RESERVED.ENV); let originPath = path.join(app.getBase(), Constants.FILEPATH.LOG); let presentPath = path.join(app.getBase(), Constants.FILEPATH.CONFIG_DIR, env, path.basename(Constants.FILEPATH.LOG)); if (_checkCanRequire(originPath)) { log.configure(app, originPath); } else if (_checkCanRequire(presentPath)) { log.configure(app, presentPath); } else { logger.error('logger file path configuration is error.'); } } }
function configure(configOrFilename: string | Config, opts?: { [key: string]: any }) { let filename = configOrFilename as string; configOrFilename = configOrFilename || process.env.LOG4JS_CONFIG; opts = opts || {} as Config;
if (!process.env.RAW_MESSAGE) { if (process.env.LOGGER_PREFIX) { if (args.length > 1) { p = '[' + process.env.LOGGER_PREFIX + prefix + '] '; } else if (process.env.LOGGER_PREFIX) { p = '[' + process.env.LOGGER_PREFIX + '] '; if (args.length && process.env.LOGGER_LINE) { p = getLine() + ': ' + p; arguments[0] = p + arguments[0]; if (item === 'error' && process.env.ERROR_STACK) { arguments[0] += (new Error()).stack;
/** * Configure logger with {$base}/config/log4js.json * * @param {Object} logger pinus-logger instance without configuration * * @memberOf Application */ configureLogger(logger: ILogger) { if (process.env.POMELO_LOGGER !== 'off') { let serverId = this.getServerId(); let base = this.getBase(); let env = this.get(Constants.RESERVED.ENV); let originPath = path.join(base, Constants.FILEPATH.LOG); let presentPath = path.join(base, Constants.FILEPATH.CONFIG_DIR, env, path.basename(Constants.FILEPATH.LOG)); if (this._checkCanRequire(originPath)) { logger.configure(originPath, { serverId: serverId, base: base }); } else if (this._checkCanRequire(presentPath)) { logger.configure(presentPath, { serverId: serverId, base: base }); } else { console.error('logger file path configuration is error.'); } } }
(process.env.NODE_PATH || '') .split(path.delimiter) .filter(folder => folder && !path.isAbsolute(folder)) .map(folder => path.resolve(appDirectory, folder)) .join(path.delimiter)
private get secondsToUpdateStore() : number { if ( process.env.SECONDS_TO_UPDATE_STORE) return parseInt(process.env.SECONDS_TO_UPDATE_STORE); //Default value return 60; }
// Start server server.listen(process.env.PORT || 3978, () => { console.log(`Bot Framework listening to ${server.url}`); });
function analyzeImage(image) { let oxford = require('project-oxford'); let cogClient = new oxford.Client(process.env.COGNITIVE_SERVICES_KEY); return cogClient.vision.analyzeImage({ path: image, Tags: true, Description: true }); }
const openConnection: any = async () => { const config = process.env.IS_PROD ? configProd : configDev; return await createConnection(config); }
var isServerRendering = function () { if (_isServer === undefined) { /* istanbul ignore if */ if (!inBrowser && !inWeex && typeof global !== 'undefined') { // detect presence of vue-server-renderer and avoid // Webpack shimming the process _isServer = global['process'] && global['process'].env.VUE_ENV === 'server'; } else { _isServer = false; } } return _isServer }
//#endregion //#region Accessors protected get serviceConfiguration() { let config : entifix.EntifixAppConfig = { serviceName: 'ratings-management-location', mongoService: process.env.MONGO_SERVICE || 'localhost:27017/ratings-management-location-db', cors: { enable: true }, protectRoutes: { enable: false }, devMode: true } return config; }
// Start server server.listen(process.env.PORT || 3978, () => { console.log(`Bot Framework listening to ${server.url}`); });