import { type GlobalPromptMiddleware } from "https://deno.land/x/cliffy@v1.0.0-rc.1/prompt/prompt.ts";
Prompt middleware function.
import { prompt } from "./prompt.ts";
import { Input } from "./input.ts";
const result = await prompt([{
name: "name",
message: "Project name",
type: Input,
}, {
name: "path",
message: "Project path",
type: Input,
}], {
async before(promptName, { name }, next) {
// do something before {promptName} excution.
await next();
// all prompts executed.
},
async after(promptName, { name }, next) {
// do something after {promptName} excution.
await next();
// all prompts executed.
}
});