Skip to content
Myr

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 file

Take it

Add `gracefulCancel` option (#1109)ehmickybefore adoptiond8190e5

lines 1–2why, one step back
1#!/usr/bin/env node
2import {onAbortedSignal} from '../helpers/graceful.js';

Require Node.js 22 (#1243)Sindre Sorhusbefore adoption04b4454

line 3why, one step back
3import {getCancelSignal, getOneMessage, sendMessage} from 'execa';

Add `gracefulCancel` option (#1109)ehmickybefore adoptiond8190e5

lines 4–9why, one step back
4
5const message = await getOneMessage();6const cancelSignal = await getCancelSignal();7await sendMessage(message);8await onAbortedSignal(cancelSignal);9await sendMessage(cancelSignal.reason);