new AppInfo()
Meta information of the application
Members
baseDir :String
The current directory, where the application code is.
env :String
The environment of the application, it's not NODE_ENV
- from
$baseDir/config/env
- from EGG_SERVER_ENV
- from NODE_ENV
env | description |
---|---|
test | system integration testing |
prod | production |
local | local on your own computer |
unittest | unit test |
- Source:
- See:
HOME :String
The use directory, same as process.env.HOME
name :String
The name of the application, retrieve from the name property in package.json
.
pkg :Object
parsed from package.json
root :String
The directory whether is baseDir or HOME depend on env. it's good for test when you want to write some file to HOME, but don't want to write to the real directory, so use root to write file to baseDir instead of HOME when unittest. keep root directory in baseDir when local and unittest