Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 24, 2024 via pnpm

enquirer 2.4.1

Stylish, intuitive and user-friendly prompt system. Fast and lightweight enough for small projects, powerful and extensible enough for the most advanced use cases.
Package summary
Share
0
issues
1
license
4
MIT
Package created
21 Aug 2016
Version published
28 Jul 2023
Maintainers
2
Total deps
4
Direct deps
2
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
4 Packages, Including:
ansi-colors@4.1.3
ansi-regex@5.0.1
enquirer@2.4.1
strip-ansi@6.0.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

2
All Dependencies CSV
β“˜ This is a list of enquirer 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
ansi-colors4.1.38.53 kBMIT
prod
strip-ansi6.0.11.99 kBMIT
prod

Visualizations

Frequently Asked Questions

What does enquirer do?

Enquirer is a stylish, intuitive, and user-friendly prompt system for Node.js. It is designed to be fast and lightweight, making it suitable for small projects, while also being powerful and extensible, thus catering to the most advanced use cases. It offers a range of different prompts, including input prompts, list prompts, confirm prompts, and multiple select prompts among others, in a conversational style. Notably, enquirer places a strong emphasis on easy implementation, user experience, and customizability.

How do you use enquirer?

Using Enquirer is quite straightforward. After installing it through npm or yarn, you simply require the package in your project and use it to create prompts. Here are some examples:

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

// Single prompt
const response = await prompt({
  type: 'input',
  name: 'username',
  message: 'What is your username?'
});

console.log(response); // { username: 'jonschlinkert' }

// Multiple prompts
const response = await prompt([
  {
    type: 'input',
    name: 'name',
    message: 'What is your name?'
  },
  {
    type: 'input',
    name: 'username',
    message: 'What is your username?'
  }
]);

console.log(response); // { name: 'Edward Chan', username: 'edwardmchan' }

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

const prompt = new Confirm({
  name: 'question',
  message: 'Did you like enquirer?'
});

prompt.run()
  .then(answer => console.log('Answer:', answer));

The prompt() function can be used with a single question object or an array of question objects. This function returns a Promise that resolves to an answers object.

Where are the enquirer docs?

The documentation for Enquirer can be found in the project's GitHub repository. There you will find an extensive README file that includes a getting started guide, clear usage examples, and detailed descriptions of the various prompt options and features available. In particular, you can learn more about built-in prompts, custom prompts, key bindings, options, and more. Also, it is worth noting that the examples directory in the repository provides a number of example scripts that demonstrate various use-cases for Enquirer prompts.