@mornya/cli-libs
Version:
The project of the utilities for CLI.
1 lines • 507 B
JavaScript
;var s=this&&this.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},e=(Object.defineProperty(exports,"__esModule",{value:!0}),exports.pressed=void 0,s(require("readline")));exports.pressed=function pressed(t){function f(){process.stdin.isTTY&&!s&&process.stdin.setRawMode(!1)}e.default.emitKeypressEvents(process.stdin);var s=process.stdin.isRaw;process.stdin.isTTY&&!s&&process.stdin.setRawMode(!0),process.stdin.resume(),process.stdin.on("keypress",function(s,e){e&&t(e,f)})};