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

enquirer

Package Overview
Dependencies
Maintainers
2
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enquirer

Stylish, intuitive and user-friendly prompt system. Fast and lightweight enough for small projects, powerful and extensible enough for the most advanced use cases.

  • 2.4.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
18M
decreased by-0.76%
Maintainers
2
Weekly downloads
 
Created

What is enquirer?

The enquirer npm package is a stylish, intuitive, and user-friendly way to interact with users via the command line. It provides a rich set of prompt types and utilities to make CLI development easier and more interactive.

What are enquirer's main functionalities?

Text Input

This feature allows you to ask users for text input. The example shows how to ask for a username.

const { prompt } = require('enquirer');

prompt({
  type: 'input',
  name: 'username',
  message: 'What is your username?'
}).then(answer => console.log('Username:', answer.username));

Password Input

This feature enables you to securely ask users for a password, hiding their input on the screen.

const { prompt } = require('enquirer');

prompt({
  type: 'password',
  name: 'password',
  message: 'What is your password?'
}).then(answer => console.log('Password:', answer.password));

Multiple Choice (Select)

This feature allows users to choose from a list of options. The example demonstrates asking users to pick a color from a list.

const { prompt } = require('enquirer');

prompt({
  type: 'select',
  name: 'color',
  message: 'Pick a color',
  choices: ['Red', 'Green', 'Blue']
}).then(answer => console.log('Selected color:', answer.color));

Checkbox

This feature lets users select multiple options from a list. The example asks users to select their favorite fruits.

const { prompt } = require('enquirer');

prompt({
  type: 'multiselect',
  name: 'fruits',
  message: 'What are your favorite fruits?',
  choices: ['Apple', 'Orange', 'Grape', 'Watermelon']
}).then(answer => console.log('Favorite fruits:', answer.fruits));

Other packages similar to enquirer

Keywords

FAQs

Package last updated on 28 Jul 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