graceful-send-echo.js
This file
Path
test/fixtures/graceful-send-echo.js
9 lines · 334 bytes · JavaScript
Last changed by
Require Node.js 22 (#1243)Sindre Sorhusbefore adoption04b4454
History of this fileTake it
Add `gracefulCancel` option (#1109)ehmickybefore adoptiond8190e5
lines 1–2why, one step back1#!/usr/bin/env node2import {onAbortedSignal} from '../helpers/graceful.js';Require Node.js 22 (#1243)Sindre Sorhusbefore adoption04b4454
line 3why, one step back3import {getCancelSignal, getOneMessage, sendMessage} from 'execa';Add `gracefulCancel` option (#1109)ehmickybefore adoptiond8190e5
lines 4–9why, one step back45const message = await getOneMessage();6const cancelSignal = await getCancelSignal();7await sendMessage(message);8await onAbortedSignal(cancelSignal);9await sendMessage(cancelSignal.reason);