How to use the std-env.dev function in std-env

To help you get started, we’ve selected a few std-env 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 nuxt / nuxt.js / packages / config / src / config / _common.js View on Github external
export default () => ({
  // Env
  dev: Boolean(env.dev),
  test: Boolean(env.test),
  debug: undefined, // = dev
  env: {},

  // Mode
  mode: 'universal',
  modern: undefined,

  // Globals
  globalName: `nuxt`,
  globals: {
    id: globalName => `__${globalName}`,
    nuxt: globalName => `$${globalName}`,
    context: globalName => `__${globalName.toUpperCase()}__`,
    pluginPrefix: globalName => globalName,
    readyCallback: globalName => `on${capitalize(globalName)}Ready`,
github nuxt / nuxt.js / lib / common / nuxt.config.js View on Github external
import path from 'path'
import fs from 'fs'
import env from 'std-env'

const nuxtDir = fs.existsSync(path.resolve(__dirname, '..', 'package.json'))
  ? path.resolve(__dirname, '..') // dist
  : path.resolve(__dirname, '..', '..') // src

export default {
  // Information about running environment
  dev: Boolean(env.dev),
  debug: undefined, // = dev

  // Mode
  mode: 'universal',

  // Server options
  server: {
    https: false,
    port: process.env.NUXT_PORT ||
      process.env.PORT ||
      process.env.npm_package_config_nuxt_port,
    host: process.env.NUXT_HOST ||
      process.env.HOST ||
      process.env.npm_package_config_nuxt_host
  },

std-env

Runtime agnostic JS utils

MIT
Latest version published 11 months ago

Package Health Score

79 / 100
Full package analysis

Similar packages