Skip to content

Commit

Permalink
Add support for file URLs with the inputFile option
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Dec 17, 2023
1 parent 248349c commit c340ff6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ export type Options<EncodingType extends EncodingOption = DefaultEncodingOption>
If the input is not a file, use the `input` option instead.
*/
readonly inputFile?: string;
readonly inputFile?: string | URL;
} & CommonOptions<EncodingType>;

export type SyncOptions<EncodingType extends EncodingOption = DefaultEncodingOption> = {
Expand Down
1 change: 1 addition & 0 deletions index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ execa('unicorns', {input: ''});
execa('unicorns', {input: Buffer.from('')});
execa('unicorns', {input: process.stdin});
execa('unicorns', {inputFile: ''});
execa('unicorns', {inputFile: new URL('file:///test')});
execa('unicorns', {stdin: 'pipe'});
execa('unicorns', {stdin: 'overlapped'});
execa('unicorns', {stdin: 'ipc'});
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ If the input is a file, use the [`inputFile` option](#inputfile) instead.

#### inputFile

Type: `string`
Type: `string | URL`

Use a file as input to the the `stdin` of your binary.

Expand Down

0 comments on commit c340ff6

Please sign in to comment.