How to use the std-env.tty 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 pimlie / nuxt-memwatch / lib / module.js View on Github external
this.nuxt.hook(nuxtHook, async () => {
    const logger = consola.withScope('memwatch')

    if (!env.tty) {
      logger.info('No tty found, nuxt-memwatch will not run')
      return
    }

    options = setOptions(this.options.memwatch || options)

    if (options.autoHeapDiff && !this.options.dev) {
      logger.warn(`Creating heapDiffs is very expensive, only enable this in production if you really have to`)
    }

    options.appName = 'nuxt-memwatch'
    options.groupName = 'nuxt-memwatch'
    options.gcAfterEvery = options.gcAfterEvery || 0

    if (options.graph) {
      let requestCounter = 0

std-env

Runtime agnostic JS utils

MIT
Latest version published 11 months ago

Package Health Score

79 / 100
Full package analysis

Similar packages