diff --git a/lib/login.js b/lib/login.js index 8a831d0..337661a 100644 --- a/lib/login.js +++ b/lib/login.js @@ -3,15 +3,13 @@ import fetch from 'node-fetch'; import * as cfg from './cfg'; import { stringify as stringifyQuery } from 'querystring'; -const stdin = process.openStdin(); - function readEmail () { return new Promise((resolve, reject) => { process.stdout.write('> Enter your email address: '); - stdin.on('data', (d) => { - stdin.destroy(); + process.stdin.on('data', (d) => { + process.stdin.pause(); resolve(d.toString().trim()); - }); + }).resume(); }); }