3.0.1 • Published 5 months ago

read v3.0.1

Weekly downloads
3,568,652
License
ISC
Repository
github
Last release
5 months ago

read

For reading user input from stdin.

Similar to the readline builtin's question() method, but with a few more features.

Usage

const { read } = require('read')
// or with ESM: import { read } from 'read'
try {
  const result = await read(options)
} catch (er) {
  console.error(er)
}

Options

Every option is optional.

  • prompt What to write to stdout before reading input.
  • silent Don't echo the output as the user types it.
  • replace Replace silenced characters with the supplied character value.
  • timeout Number of ms to wait for user input before giving up.
  • default The default value if the user enters nothing.
  • edit Allow the user to edit the default value.
  • terminal Treat the output as a TTY, whether it is or not.
  • input Readable stream to get input data from. (default process.stdin)
  • output Writable stream to write prompts to. (default: process.stdout)
  • completer Autocomplete callback (see official api for details

If silent is true, and the input is a TTY, then read will set raw mode, and read character by character.

Contributing

Patches welcome.

npmpromzardpromptlyinit-package-json@tyz-wallet/tyz-wallet-core-service@stoked-cenv/cenv-libarchetype-library@kafelix496/promptkilli8n-react-native-fast-imagespike-pdf-toolskdjfjlskdfjkyc-clibraunny-surgebraunny-autolink-cacaroto@cashremit/cr-streamline-iconsproject-start@frxf/frxfxinyuo@deadcanaries/orc@orcproject/orcbitcore-wallet-service-sprcep_collabtickergithub-build-hooktix-clifarm_kser_clientv2@joaoahmad/mono-buttonsendautomessengermessagephonegap-build-gruntcogoportutilseasycoregtpmgtmpjcsc-admin@mink-opn/build-tokens@infinitebrahmanuniverse/nolb-read@everything-registry/sub-chunk-2628anyfetch-file-watcherapi-cli@anthonyjdella/customized-resume-cli@apility/netflex-cli@apility/netflex-devtoolappfacapib-confluencerapigee-org-admin@atom-ide-community/atom-package-managerapigeetoolarti-bundle3s@ztimson/pumpkinpie@abcpros/bitcore-wallet@abcpros/bitcore-wallet-serviceack-resume-cli@ai-id/aigx-sdkaidbox-cliaigx-test-sdkagear-starter-launchaidaagera-app-hotupdateahj@adora-wallet/adoracore-wallet@adora-wallet/adoracore-wallet-service@ucipass/www@tpp/luminate@webdesignio/cli@whitecolor/yarn@windraxb/ftp-deploy@woleet/woleet-secure-module@wishcore/reason-cli@winner-fed/ftp-deployadoc2gfm28421752593pro@0xcda7a/npm@zzwy/wy-upload-serve@zzwy/wy-m-cliaaaaaserver@alancnet/yarn1000-packages@bb301/simple-encryption-utilautoer@beisen/npmautomated-surge@betacodd/lighthouse-packagearduboyap3-cliapocket-apiapocket-cliarifbudixzassets-optimizator@bret/ghauth@buzuli/ops-tools@butternetwork/bridgebhf-clibhidbig-berthaatc-cliatlas-connectattatom-package-managerask-prompt
3.0.1

5 months ago

3.0.0

5 months ago

2.1.0

1 year ago

2.0.0

1 year ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

11 years ago

1.0.4

12 years ago

1.0.3

12 years ago

1.0.2

12 years ago

1.0.1

12 years ago

1.0.0

12 years ago

0.1.1

12 years ago

0.1.0

12 years ago

0.0.3

12 years ago

0.0.2

12 years ago

0.0.1

12 years ago