From 56fb4429e63d3663a6fc2f23252ae69816b885f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9e=20Kooi?= Date: Wed, 15 Aug 2018 17:37:18 +0200 Subject: [PATCH] NODE_OPTIONS is available in 8.0.0 --- autocannon.js | 5 +++-- package.json | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/autocannon.js b/autocannon.js index 62056e6e..01cbf533 100755 --- a/autocannon.js +++ b/autocannon.js @@ -8,7 +8,7 @@ const os = require('os') const net = require('net') const path = require('path') const URL = require('url').URL -const nitm = require('nitm') +const spawn = require('child_process').spawn const managePath = require('manage-path') const hasAsyncHooks = require('has-async-hooks') const help = fs.readFileSync(path.join(__dirname, 'help.txt'), 'utf8') @@ -193,9 +193,10 @@ function start (argv) { const alterPath = managePath({ PATH: process.env.NODE_PATH }) alterPath.unshift(path.join(__dirname, 'lib/preload')) - nitm(['-r', 'autocannonDetectPort'], argv.spawn, { + spawn(argv.spawn[0], argv.spawn.slice(1), { stdio: ['ignore', 'inherit', 'inherit'], env: Object.assign({}, process.env, { + NODE_OPTIONS: ['-r', 'autocannonDetectPort'].join(' '), NODE_PATH: alterPath.get(), AUTOCANNON_SOCKET: socketPath }) diff --git a/package.json b/package.json index 40f43765..16b67aef 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,6 @@ "hyperid": "^1.4.1", "manage-path": "^2.0.0", "minimist": "^1.2.0", - "nitm": "^1.0.2", "on-net-listen": "^1.1.1", "pretty-bytes": "^5.1.0", "progress": "^2.0.0",