How to use node-preload - 1 common examples

To help you get started, we’ve selected a few node-preload 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 istanbuljs / nyc / bin / nyc.js View on Github external
}

  /* istanbul ignore else */
  if (argv['babel-cache'] === false) {
    // babel's cache interferes with some configurations, so is
    // disabled by default. opt in by setting babel-cache=true.
    env.BABEL_DISABLE_CACHE = process.env.BABEL_DISABLE_CACHE = '1'
  }

  if (!argv.useSpawnWrap) {
    const requireModules = [
      require.resolve('../lib/register-env.js'),
      ...nyc.require.map(mod => resolveFrom.silent(nyc.cwd, mod) || mod)
    ]
    const preloadList = require('node-preload')
    preloadList.push(
      ...requireModules,
      require.resolve('../lib/wrap.js')
    )

    Object.assign(process.env, env)
    requireModules.forEach(mod => {
      require(mod)
    })
  }

  if (argv.all) {
    await nyc.addAllFiles()
  }

  if (argv.useSpawnWrap) {
    const wrapper = require.resolve('./wrap.js')

node-preload

Request that Node.js child processes preload modules

MIT
Latest version published 5 years ago

Package Health Score

65 / 100
Full package analysis

Popular node-preload functions

Similar packages