ipc-process-error.js
This file
Path
test/fixtures/ipc-process-error.js
11 lines · 438 bytes · JavaScript
Last changed by
Update dev dependencies (#1257)Sindre Sorhusbefore adoption5944b2d
History of this fileTake it
Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
lines 1–2why, one step back1#!/usr/bin/env node2import process from 'node:process';Do not disconnect IPC on `error` event on process (#1086)ehmickybefore adoptiond6f5d9a
line 3why, one step back3import {getOneMessage, sendMessage} from '../../index.js';Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
line 4why, one step back4import {foobarString} from '../helpers/input.js';Update dev dependencies (#1257)Sindre Sorhusbefore adoption5944b2d
line 5why, one step back5import {isAlwaysTrue} from '../helpers/ipc.js';Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68
line 6why, one step back6Do not disconnect IPC on `error` event on process (#1086)ehmickybefore adoptiond6f5d9a
line 7why, one step back7process.on('error', () => {});Update dev dependencies (#1257)Sindre Sorhusbefore adoption5944b2d
line 8why, one step back8const filter = process.argv[2] === 'true' ? isAlwaysTrue : undefined;Do not disconnect IPC on `error` event on process (#1086)ehmickybefore adoptiond6f5d9a
lines 9–11why, one step back9const promise = getOneMessage({filter});10process.emit('error', new Error(foobarString));11await sendMessage(await promise);