import { type PromptMiddleware } from "https://deno.land/x/cliffy@v1.0.0-rc.1/prompt/mod.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,
async after({ name }, next) {
// name prompt executed.
await next();
// path prompt executed.
}
}, {
name: "path",
message: "Project path",
type: Input,
async before({ name }, next) {
// name prompt executed.
await next();
// path prompt executed.
}
}]);