Skip to content

Commit 834e372

Browse files
committedOct 27, 2023
Require Node.js 18
1 parent 0d038e0 commit 834e372

File tree

5 files changed

+15
-38
lines changed

5 files changed

+15
-38
lines changed
 

‎.github/workflows/main.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,18 @@ jobs:
1212
node-version:
1313
- 20
1414
- 18
15-
- 16
1615
os:
1716
- ubuntu-latest
1817
- macos-latest
1918
- windows-latest
2019
steps:
21-
- uses: actions/checkout@v3
22-
- uses: actions/setup-node@v3
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-node@v4
2322
with:
2423
node-version: ${{ matrix.node-version }}
2524
- run: npm install
2625
- run: npm test
27-
- uses: codecov/codecov-action@v2
26+
- uses: codecov/codecov-action@v3
2827
if: matrix.os == 'ubuntu-latest' && matrix.node-version == 20
2928
with:
3029
fail_ci_if_error: true

‎index.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ export type Options<EncodingType extends EncodingOption = DefaultEncodingOption>
279279
280280
If the input is a file, use the `inputFile` option instead.
281281
*/
282-
readonly input?: string | Buffer | ReadableStream;
282+
readonly input?: string | Uint8Array | ReadableStream;
283283

284284
/**
285285
Use a file as input to the the `stdin` of your binary.
@@ -295,7 +295,7 @@ export type SyncOptions<EncodingType extends EncodingOption = DefaultEncodingOpt
295295
296296
If the input is a file, use the `inputFile` option instead.
297297
*/
298-
readonly input?: string | Buffer;
298+
readonly input?: string | Uint8Array;
299299

300300
/**
301301
Use a file as input to the the `stdin` of your binary.

‎lib/stream.js

+2-12
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {createReadStream, readFileSync} from 'node:fs';
22
import {setTimeout} from 'node:timers/promises';
33
import {isStream} from 'is-stream';
44
import getStream, {getStreamAsBuffer} from 'get-stream';
5-
import mergeStream from 'merge-stream';
5+
import mergeStreams from '@sindresorhus/merge-streams';
66

77
const validateInputOptions = input => {
88
if (input !== undefined) {
@@ -60,17 +60,7 @@ export const makeAllStream = (spawned, {all}) => {
6060
return;
6161
}
6262

63-
const mixed = mergeStream();
64-
65-
if (spawned.stdout) {
66-
mixed.add(spawned.stdout);
67-
}
68-
69-
if (spawned.stderr) {
70-
mixed.add(spawned.stderr);
71-
}
72-
73-
return mixed;
63+
return mergeStreams([spawned.stdout, spawned.stderr].filter(Boolean));
7464
};
7565

7666
// On failure, `result.stdout|stderr|all` should contain the currently buffered stream

‎package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"default": "./index.js"
1717
},
1818
"engines": {
19-
"node": ">=16.17"
19+
"node": ">=18"
2020
},
2121
"scripts": {
2222
"test": "xo && c8 ava && tsd"
@@ -45,27 +45,27 @@
4545
"zx"
4646
],
4747
"dependencies": {
48+
"@sindresorhus/merge-streams": "^1.0.0",
4849
"cross-spawn": "^7.0.3",
4950
"get-stream": "^8.0.1",
5051
"human-signals": "^5.0.0",
5152
"is-stream": "^3.0.0",
52-
"merge-stream": "^2.0.0",
5353
"npm-run-path": "^5.1.0",
5454
"onetime": "^6.0.0",
5555
"signal-exit": "^4.1.0",
5656
"strip-final-newline": "^3.0.0"
5757
},
5858
"devDependencies": {
59-
"@types/node": "^20.4.0",
60-
"ava": "^5.2.0",
59+
"@types/node": "^20.8.9",
60+
"ava": "^5.3.1",
6161
"c8": "^8.0.1",
62-
"get-node": "^14.2.0",
62+
"get-node": "^14.2.1",
6363
"is-running": "^2.1.0",
6464
"p-event": "^6.0.0",
6565
"path-key": "^4.0.0",
6666
"tempfile": "^5.0.0",
67-
"tsd": "^0.28.1",
68-
"xo": "^0.55.0"
67+
"tsd": "^0.29.0",
68+
"xo": "^0.56.0"
6969
},
7070
"c8": {
7171
"reporter": [

‎readme.md

+1-13
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ If the spawned process fails, [`error.stdout`](#stdout), [`error.stderr`](#stder
541541

542542
#### input
543543

544-
Type: `string | Buffer | stream.Readable`
544+
Type: `string | Uint8Array | stream.Readable`
545545

546546
Write some input to the `stdin` of your binary.\
547547
Streams are not allowed when using the synchronous methods.
@@ -808,15 +808,3 @@ await execa(binPath);
808808

809809
- [Sindre Sorhus](https://github.com/sindresorhus)
810810
- [@ehmicky](https://github.com/ehmicky)
811-
812-
---
813-
814-
<div align="center">
815-
<b>
816-
<a href="https://tidelift.com/subscription/pkg/npm-execa?utm_source=npm-execa&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
817-
</b>
818-
<br>
819-
<sub>
820-
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
821-
</sub>
822-
</div>

0 commit comments

Comments
 (0)
Please sign in to comment.