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 Feb 27, 2024 via pnpm

prompts 0.1.9

Lightweight, beautiful and user-friendly prompts
Package summary
Share
2
issues
1
critical severity
license
1
1
high severity
meta
1
2
licenses
2
MIT
1
N/A
Package created
18 Feb 2018
Version published
19 Jun 2018
Maintainers
1
Total deps
3
Direct deps
2
License
UNKNOWN

Issues

2

1 critical severity issue

critical
Recommendation: Check the package code and files for license information
via: prompts@0.1.9
Collapse
Expand

1 high severity issue

high
via: clorox@1.0.3
Collapse
Expand

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
2 Packages, Including:
clorox@1.0.3
sisteransi@0.1.1

N/A

N/A
1 Packages, Including:
prompts@0.1.9
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 prompts 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
clorox1.0.32.59 kBMIT
prod
1
sisteransi0.1.12.34 kBMIT
prod

Visualizations

Frequently Asked Questions

What does prompts do?

Prompts is a lightweight, user-friendly, and attractive NPM package that provides interactive command line interfaces. Specific features that make Prompts stand out include its use of promises and async/await functionality, eliminating callback clutter. Each prompt type is independent and can be used separately. Their interfaces leverage layout and colors to create a beautiful CLI experience.

How do you use prompts?

To use prompts, you'll first need to install the NPM package in your project using the command npm install --save prompts. After this, you can import it into your JavaScript file with const prompts = require('prompts');

There are multiple ways to use prompts, depending on the interaction you want with the user. Here are a few examples:

For a single text prompt usage:

const prompts = require('prompts');

(async () => {
  const response = await prompts({
    type: 'text',
    name: 'meaning',
    message: 'What is the meaning of life?'
});

console.log(response.meaning);
})();

For multiple questions, you can chain the prompts together:

const prompts = require('prompts');

const questions = [
  {
    type: 'text',
    name: 'username',
    message: 'What is your GitHub username?'
  },
  {
    type: 'number',
    name: 'age',
    message: 'How old are you?'
  },
  {
    type: 'text',
    name: 'about',
    message: 'Tell something about yourself',
    initial: 'Why should I?'
  }
];

(async () => {
  const response = await prompts(questions);

  // => response => { username, age, about }
})();

Dynamic prompts, where the property values can be functions are also supported:

const prompts = require('prompts');

const questions = [
  {
    type: 'text',
    name: 'dish',
    message: 'Do you like pizza?'
  },
  {
    type: prev => prev == 'pizza' ? 'text' : null,
    name: 'topping',
    message: 'Name a topping'
  }
];

(async () => {
  const response = await prompts(questions);
})();

Where are the prompts docs?

The Prompts documentation can be found directly in its README file on its GitHub page, at the URL https://github.com/terkelg/prompts. The README contains detailed information on how to install and use Prompts, examples of its usage, API details, and more.