mew-time
Version:
utils about the time.
44 lines (40 loc) • 876 B
JavaScript
import environment from "./helper/environment.helper";
import path from "./helper/path.helper";
class App {
constructor(service, env) {
/**
* 서비스 이름
*/
this.service = service;
/**
* 프로젝트 패스
*/
this.path = path();
environment.call(this, env);
}
/**
* 환경 정보를 가져온다.
*/
config(name) {
return name ? this._conf[name] : this._conf;
}
/**
* 개발 모드인지 판단한다.
*/
isDevelopment() {
return this.config("env").dev;
}
/**
* 배포 모드인지 판단한다.
*/
isProduction() {
return this.config("env").prod;
}
/**
* 테스트 모드인지 판단한다.
*/
isTest() {
return this.config("env").test;
}
}
export default App;