You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
285 B
15 lines
285 B
'use strict';
|
|
|
|
/**
|
|
* @param {NodeJS.ReadStream} [stdin]
|
|
* @returns {Promise<string>}
|
|
*/
|
|
module.exports = async function getStdin(stdin = process.stdin) {
|
|
const chunks = [];
|
|
|
|
for await (const chunk of stdin) {
|
|
chunks.push(chunk);
|
|
}
|
|
|
|
return Buffer.concat(chunks).toString();
|
|
};
|
|
|