Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function setRaw(mode) {
return process.stdin.setRawMode ?
process.stdin.setRawMode(mode) : tty.setRawMode(mode);
}
function setRawMode(val) {
if (process.stdin.setRawMode)
process.stdin.setRawMode(val);
else
require('tty').setRawMode(val);
}
function setRawMode(mode) {
if (process.stdin.setRawMode) {
process.stdin.setRawMode(mode);
}
else if (process.stderr.isTTY) {
tty.setRawMode(mode);
}
}
if (hideInput) setRawMode(true);