How to use the std-env.windows 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 / test / utils / setup.js View on Github external
import consola from 'consola'
import chalk from 'chalk'
import env from 'std-env'
import exit from 'exit'

const isWin = env.windows

describe.win = isWin ? describe : describe.skip
test.win = isWin ? test : test.skip

describe.posix = !isWin ? describe : describe.skip
test.posix = !isWin ? test : test.skip

chalk.enabled = false

jest.setTimeout(60000)

consola.mockTypes(() => jest.fn())

function errorTrap (error) {
  process.stderr.write('\n' + error.stack + '\n')
  exit(1)
github nuxt / nuxt.js / packages / cli / src / utils / index.js View on Github external
import path from 'path'
import exit from 'exit'

import { lock } from '@nuxt/utils'
import chalk from 'chalk'
import env from 'std-env'
import { warningBox } from './formatting'

export const eventsMapping = {
  add: { icon: '+', color: 'green', action: 'Created' },
  change: { icon: env.windows ? '»' : '↻', color: 'blue', action: 'Updated' },
  unlink: { icon: '-', color: 'red', action: 'Removed' }
}

export function formatPath (filePath) {
  if (!filePath) {
    return
  }
  return filePath.replace(process.cwd() + path.sep, '')
}

/**
 * Normalize string argument in command
 *
 * @export
 * @param {String} argument
 * @param {*} defaultValue

std-env

Runtime agnostic JS utils

MIT
Latest version published 11 months ago

Package Health Score

79 / 100
Full package analysis

Similar packages