Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor() {
return Object.assign(this, yenv());
}
import yenv from 'yenv'
import { logger } from './logger'
process.env.NODE_ENV = process.env.NODE_ENV || 'development'
/**
* We just export what `yenv()` returns.
* `keyblade` will make sure we don't rely on undefined values.
*/
export const env = yenv('env.yaml', {
message: key => `[yenv] ${key} not found in the loaded environment`,
logBeforeThrow: message => logger.error(message)
})
import yenv from 'yenv';
import { keyblade } from 'keyblade';
import { logger } from './logger';
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
/**
* We just export what `yenv()` returns.
* `keyblade` will make sure we don't rely on undefined values.
*/
export const env = keyblade(yenv(), {
message: key => `[yenv] ${key} not found in the loaded environment`,
logBeforeThrow: message => logger.error(message)
});
import yenv from 'yenv'
import { logger } from './logger'
/**
* export what `yenv()` returns 环境变量配置
*/
process.env.NODE_ENV = process.env.NODE_ENV || 'development'
export const env = yenv('env.yaml', {
message: key => `[yenv] ${key} not found in the loaded environment`,
logBeforeThrow: message => logger.error(message)
})