askcharacter
TypeScript icon, indicating that this package has built-in type declarations

2.0.4 • Public • Published

askcharacter

Prompt for a single character

import askcharacter from 'askcharacter';

console.log('Please enter a character:');
const char = await askcharacter(process.stdin);
console.log('You entered the following askcharacter:', char.toString());

The stream passed to askcharacter can be any kind of Readable stream. If it is a TTY, askcharacter will temporarily remove all other 'data' and 'readable' listeners from it, and set the TTY into raw mode if it has not been in raw mode to begin with.

Why not use read instead?

Because read does not work inside a Node.js REPL.

LICENSE

Apache-2.0

Readme

Keywords

Package Sidebar

Install

npm i askcharacter

Weekly Downloads

19,973

Version

2.0.4

License

Apache-2.0

Unpacked Size

18.3 kB

Total Files

7

Last publish

Collaborators

  • orechova
  • himanshusinghs
  • c-buckingham
  • mongo-j
  • mabaasit
  • alexander_schroll
  • chuck.kalmanek
  • mongodb-js-user
  • rueckstiess
  • durran
  • lerouxb
  • fredtruman
  • mbroadst
  • hswolff
  • satyasinha
  • matt_d_rat
  • rhysm
  • tomhollander
  • alena.khineika
  • jeff-allen-mongo
  • mmarcon
  • jonathan.balsano
  • mongodb-build
  • jack.weir
  • stennie
  • mcasimir
  • kristina.stefano
  • jarjee
  • shaketbaby
  • devtoolsbot
  • addaleax
  • gribnoysup
  • mutukrish