Sha256: 35b451c1a4e32567a7d5e5966f8e2f990a83f49c991de96727b8b722ab41edf3
Contents?: true
Size: 497 Bytes
Versions: 34
Compression:
Stored size: 497 Bytes
Contents
'use strict'; const {stdin} = process; module.exports = async () => { let result = ''; if (stdin.isTTY) { return result; } stdin.setEncoding('utf8'); for await (const chunk of stdin) { result += chunk; } return result; }; module.exports.buffer = async () => { const result = []; let length = 0; if (stdin.isTTY) { return Buffer.concat([]); } for await (const chunk of stdin) { result.push(chunk); length += chunk.length; } return Buffer.concat(result, length); };
Version data entries
34 entries across 34 versions & 2 rubygems