1 | declare const getStdin: {
|
2 | /**
|
3 | Get [`stdin`](https://nodejs.org/api/process.html#process_process_stdin) as a `string`.
|
4 |
|
5 | @returns A promise that is resolved when the `end` event fires on the `stdin` stream, indicating that there is no more data to be read. In a TTY context, an empty `string` is returned.
|
6 |
|
7 | @example
|
8 | ```
|
9 | // example.ts
|
10 | import getStdin from 'get-stdin';
|
11 |
|
12 | console.log(await getStdin());
|
13 | //=> 'unicorns'
|
14 |
|
15 | // $ echo unicorns | ts-node example.ts
|
16 | // unicorns
|
17 | ```
|
18 | */
|
19 | (): Promise<string>;
|
20 |
|
21 | /**
|
22 | Get [`stdin`](https://nodejs.org/api/process.html#process_process_stdin) as a `Buffer`.
|
23 |
|
24 | @returns A promise that is resolved when the `end` event fires on the `stdin` stream, indicating that there is no more data to be read. In a TTY context, an empty `Buffer` is returned.
|
25 | */
|
26 | buffer(): Promise<Buffer>;
|
27 | };
|
28 |
|
29 | export default getStdin;
|