monkeeShark/src/utils/environmentInfo.ts

15 lines
398 B
TypeScript
Raw Normal View History

2016-12-30 18:35:19 +00:00
import Logger from './logger';
2017-01-02 19:39:44 +00:00
export default class {
2017-05-24 11:50:17 +00:00
public static show(): void {
2016-12-30 18:35:19 +00:00
const env = process.env.NODE_ENV;
2017-05-24 11:50:17 +00:00
const logger = new Logger('Env');
2016-12-30 18:35:19 +00:00
logger.info(typeof env == 'undefined' ? 'NODE_ENV is not set' : `NODE_ENV: ${env}`);
2017-05-24 11:50:17 +00:00
2016-12-30 18:35:19 +00:00
if (env !== 'production') {
logger.warn('The environment is not in production mode');
logger.warn('Do not use for production purpose');
}
}
}