Skip to content
Myr

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 file

Take it

Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68

lines 1–2why, one step back
1#!/usr/bin/env node
2import process from 'node:process';

Do not disconnect IPC on `error` event on process (#1086)ehmickybefore adoptiond6f5d9a

line 3why, one step back
3import {getOneMessage, sendMessage} from '../../index.js';

Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68

line 4why, one step back
4import {foobarString} from '../helpers/input.js';

Update dev dependencies (#1257)Sindre Sorhusbefore adoption5944b2d

line 5why, one step back
5import {isAlwaysTrue} from '../helpers/ipc.js';

Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68

line 6why, one step back
6

Do not disconnect IPC on `error` event on process (#1086)ehmickybefore adoptiond6f5d9a

line 7why, one step back
7process.on('error', () => {});

Update dev dependencies (#1257)Sindre Sorhusbefore adoption5944b2d

line 8why, one step back
8const filter = process.argv[2] === 'true' ? isAlwaysTrue : undefined;

Do not disconnect IPC on `error` event on process (#1086)ehmickybefore adoptiond6f5d9a

lines 9–11why, one step back
9const promise = getOneMessage({filter});
10process.emit('error', new Error(foobarString));11await sendMessage(await promise);