mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
PR-URL: https://github.com/nodejs/node/pull/26729 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
24 lines
567 B
JavaScript
24 lines
567 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const { spawn } = require('child_process');
|
|
const net = require('net');
|
|
|
|
const tmpdir = require('../common/tmpdir');
|
|
tmpdir.refresh();
|
|
|
|
const server = net.createServer((conn) => {
|
|
conn.on('close', common.mustCall());
|
|
|
|
spawn(process.execPath, ['-v'], {
|
|
stdio: ['ignore', conn, 'ignore']
|
|
}).on('close', common.mustCall());
|
|
}).listen(common.PIPE, () => {
|
|
const client = net.connect(common.PIPE, common.mustCall());
|
|
client.on('data', () => {
|
|
client.end(() => {
|
|
server.close();
|
|
});
|
|
});
|
|
});
|