Skip to content
Myr

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 file

Take it

Fix IPC edge casesSindre Sorhusbefore adoption5f80cde

lines 1–11why, one step back
1#!/usr/bin/env node
2import process from 'node:process';3import {getOneMessage} from '../../index.js';45const messagePromise = getOneMessage();6// Execa handles incoming messages on the next macrotask, so this disconnects before it does7process.once('message', () => {8 process.disconnect();9});10process.send('.');11console.log(JSON.stringify(await messagePromise));