How to use the nyc/package.json.version function in nyc

To help you get started, we’ve selected a few nyc 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 tapjs / node-tap / bin / run.js View on Github external
'tap-parser': require('tap-parser/package.json').version,
      nyc: require('nyc/package.json').version,
      'tap-yaml': require('tap-yaml/package.json').version,
      treport: require('treport/package.json').version,
      tcompare: require('tcompare/package.json').version,
    }))
  }

  if (options.version)
    return console.log(require('../package.json').version)

  if (options['parser-version'])
    return console.log(require('tap-parser/package.json').version)

  if (options['nyc-version'])
    return console.log(require('nyc/package.json').version)

  if (options['nyc-help'])
    return nycHelp()

  process.stdout.on('error', er => {
    /* istanbul ignore else */
    if (er.code === 'EPIPE')
      process.exit()
    else
      throw er
  })

  // we test this directly, not from here.
  /* istanbul ignore next */
  if (options.watch)
    return new Repl(options, process.stdin, process.stdout)
github tapjs / node-tap / test-legacy / runner-nyc-args.js View on Github external
t.test('--nyc-version', function (t) {
    var expect = require('nyc/package.json').version + '\n'
    execFile(node, [run, '--nyc-version'], function (err, stdout, stderr) {
      if (err) {
        throw err
      }
      t.equal(stderr, '')
      t.equal(stdout, expect)
      t.end()
    })
  })
github tapjs / node-tap / test / run / basic.js View on Github external
run(['--nyc-version'], null, (er, o, e) => {
    t.equal(er, null)
    t.equal(o.trim(), require('nyc/package.json').version)
    t.end()
  })
})
github tapjs / node-tap / test / run.js View on Github external
run(['--nyc-version'], null, (er, o, e) => {
      t.equal(er, null)
      t.equal(o.trim(), require('nyc/package.json').version)
      t.end()
    })
  })
github tapjs / node-tap / bin / run.js View on Github external
if (options.reporter === null)
    options.reporter = options.color ? 'base' : 'tap'

  if (options['dump-config']) {
    console.log(yaml.stringify(Object.keys(options).filter(k =>
      k !== 'dump-config' && k !== '_' && !/^[A-Z_]+$/.test(k)
    ).sort().reduce((set, k) =>
      (set[k] = options[k], set), {})))
    return
  }

  if (options.versions) {
    return console.log(yaml.stringify({
      tap: require('../package.json').version,
      'tap-parser': require('tap-parser/package.json').version,
      nyc: require('nyc/package.json').version,
      'tap-yaml': require('tap-yaml/package.json').version,
      treport: require('treport/package.json').version,
      tcompare: require('tcompare/package.json').version,
    }))
  }

  if (options.version)
    return console.log(require('../package.json').version)

  if (options['parser-version'])
    return console.log(require('tap-parser/package.json').version)

  if (options['nyc-version'])
    return console.log(require('nyc/package.json').version)

  if (options['nyc-help'])