Programmatically create interactive prompts based on Consola, powered by Funish.
# npm
$ npm install @funish/prompt
# yarn
$ yarn add @funish/prompt
# pnpm
$ pnpm add @funish/prompt
import { usePrompt } from "@funish/prompt";
const name = await usePrompt("What is your name?", { type: "text" });
console.log(name);
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"] }
See it on JSDoc.