ipc-get-strict-disconnect.js
This file
Path
test/fixtures/ipc-get-strict-disconnect.js
11 lines · 365 bytes · JavaScript
Last changed by
Fix IPC edge casesSindre Sorhusbefore adoption5f80cde
History of this fileTake it
123456789101112#!/usr/bin/env nodeimport process from 'node:process';import {getOneMessage} from '../../index.js';
const messagePromise = getOneMessage();// Execa handles incoming messages on the next macrotask, so this disconnects before it doesprocess.once('message', () => { process.disconnect();});process.send('.');console.log(JSON.stringify(await messagePromise));