@veramo/cli
Version:
Veramo command line application.
21 lines • 665 B
JavaScript
export async function readStdin() {
return new Promise((resolve, reject) => {
let data = '';
process.stdin.setEncoding('utf-8');
process.stdin.on('readable', () => {
let chunk;
while ((chunk = process.stdin.read())) {
data += chunk;
}
});
process.stdin.on('end', () => {
// There will be a trailing \n from the user hitting enter. Get rid of it.
data = data.replace(/\n$/, '');
resolve(data);
});
process.stdin.on('error', (error) => {
reject(error);
});
});
}
//# sourceMappingURL=util.js.map