@funish/prompt
v0.0.4
Published
Programmatically create interactive prompts, powered by Funish.
Downloads
16
Readme
@funish/prompt
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.