|
3 | 3 | This package exposes a `SyncChildProcess` class that allows Node.js to run a
|
4 | 4 | subprocess synchronously *and* interactively.
|
5 | 5 |
|
| 6 | +[**API Docs**] |
| 7 | + |
| 8 | +[**API Docs**]: https://sass.github.io/sync-child-process/classes/SyncChildProcess.html |
| 9 | + |
6 | 10 | ## Usage
|
7 | 11 |
|
8 |
| -Use `new SyncChildProcess()` to start running a subprocess. This supports the |
| 12 | +Use [`new SyncChildProcess()`] to start running a subprocess. This supports the |
9 | 13 | same API as [`child_process.spawn()`] other than a few options. You can send
|
10 |
| -input to the process using `process.stdin`, and receive events from it (stdout, |
11 |
| -stderr, or exit) using `process.next()`. This implements [the iterator |
12 |
| -protocol], but *not* the iterable protocol because it's intrinsically stateful. |
| 14 | +input to the process using [`process.stdin`], and receive events from it |
| 15 | +(stdout, stderr, or exit) using [`process.next()`]. This implements [the |
| 16 | +iterator protocol], but *not* the iterable protocol because it's intrinsically |
| 17 | +stateful. |
13 | 18 |
|
14 |
| -[the iterator protocol]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol |
| 19 | +[`new SyncChildProcess()`]: https://sass.github.io/sync-child-process/classes/SyncChildProcess.html#constructor |
15 | 20 | [`child_process.spawn()`]: https://nodejs.org/api/child_process.html#child_processspawncommand-args-options
|
| 21 | +[`process.stdin`]: https://sass.github.io/sync-child-process/classes/SyncChildProcess.html#stdin |
| 22 | +[`process.next()`]: https://sass.github.io/sync-child-process/classes/SyncChildProcess.html#next |
| 23 | +[the iterator protocol]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol |
16 | 24 |
|
17 | 25 | ```js
|
18 | 26 | import {SyncChildProcess} from 'sync-child-process';
|
|
0 commit comments