How to use yenv - 4 common examples

To help you get started, we’ve selected a few yenv examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jeffijoe / koa-es7-boilerplate / src / lib / env.js View on Github external
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)
})
github inkubux / MediaSpeed / src / lib / env.js View on Github external
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)
});
github mollyywang / koa2-mongodb-jwt-server / src / lib / env.js View on Github external
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)
})

yenv

Environment management using YAML.

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis

Popular yenv functions