Skip to content
Myr

noop-fd-ipc.js

This file

Path

test/fixtures/noop-fd-ipc.js

12 lines · 441 bytes · JavaScript

Last changed by

Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68

History of this file

Take it

The walk stopped after 200 commits: lines older than 9f65b86 point at it.

100% test coverage (#1018)ehmickybefore adoption9f65b86

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

Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68

lines 3–4why, one step back
3import {promisify} from 'node:util';
4import {sendMessage} from '../../index.js';

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 5–9why, one step back
5import {getWriteStream} from '../helpers/fs.js';
6import {foobarString} from '../helpers/input.js';78const fdNumber = Number(process.argv[2]);9const bytes = process.argv[3] || foobarString;

Add promise-based IPC (#1059)ehmickybefore adoptionacc2b68

lines 10–12why, one step back
10const stream = getWriteStream(fdNumber);
11await promisify(stream.write.bind(stream))(bytes);12await sendMessage('');