Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project seems abandoned; use this simple workaround instead #28

Open
dchacke opened this issue Jun 22, 2020 · 1 comment
Open

Project seems abandoned; use this simple workaround instead #28

dchacke opened this issue Jun 22, 2020 · 1 comment

Comments

@dchacke
Copy link

dchacke commented Jun 22, 2020

I stumbled upon this project while trying to build a custom Node REPL. At first, it looked promising, but, as has been pointed out in other issues, it seems to have been abandoned.

Luckily, it looks as though there is a simple workaround that should get you going without this dependency. I've put the following together with some examples from Node's readline module.

let readline = require('readline');

readline.emitKeypressEvents(process.stdin);

process.stdin.on('keypress', (ch, key) => {
  console.log('got "keypress"', ch, key);
  if (key && key.ctrl && key.name == 'c') {
    process.stdin.pause();
  }
});

process.stdin.setRawMode(true);
@abdelshok
Copy link

Good man @dchacke.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants