Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ask-readline

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ask-readline

Ask a question for CLI using readline, supports muted input

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9
decreased by-57.14%
Maintainers
1
Weekly downloads
 
Created
Source

ask-readline

Ask a question for CLI using readline, supports muted input

npm i ask-readline

Usage

const ask = require('ask-readline')

main()

async function main () {
  const username = await ask('Input username (clear): ', { clear: true })
  const password = await ask('Input password (clear and muted): ', { clear: true, muted: true })
  const twoFactorAuth = await ask('Input 2fa (keep but muted): ', { clear: false, muted: true })
  const alias = await ask('Input alias (default): ')

  console.log({ username, password, twoFactorAuth, alias })
}

API

const answer = await ask(question, [options])

answer is a string or null.
If user does CTRL+C then answer is null.

Available options:

{
  clear: false,
  muted: false
}

clear removes the line where the question was printed.
muted ensures that input is hidden, and not written to stdout.

License

MIT

FAQs

Package last updated on 04 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc