@funish/prompt
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

@funish/prompt

npm version npm downloads npm license Contributor Covenant

Programmatically create interactive prompts based on Consola, powered by Funish.

Getting started

# npm
$ npm install @funish/prompt

# yarn
$ yarn add @funish/prompt

# pnpm
$ pnpm add @funish/prompt

Usage

Single prompt

import { usePrompt } from "@funish/prompt";

const name = await usePrompt("What is your name?", { type: "text" });

console.log(name);

Multiple prompts

import { createPrompt } from "@funish/prompt";

const prompt = await createPrompt({
  name: {
    type: "text",
  },
  private: {
    type: "confirm",
  },
  keywords: {
    type: "multiselect",
    options: ["a", "b", "c"],
  },
});

console.log(prompt);

// { name: "funish", private: true, keywords: ["a", "b"] }

Interfaces

See it on JSDoc.

License

Readme

Keywords

Package Sidebar

Install

npm i @funish/prompt

Weekly Downloads

4

Version

0.0.4

License

MIT

Unpacked Size

7.74 kB

Total Files

8

Last publish

Collaborators

  • demomacro