-
Notifications
You must be signed in to change notification settings - Fork 177
/
prompt.ts
executable file
·39 lines (33 loc) · 1 KB
/
prompt.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { consola } from "./utils";
async function main() {
const name = await consola.prompt("What is your name?", {
placeholder: "Not sure",
initial: "java",
});
const confirmed = await consola.prompt("Do you want to continue?", {
type: "confirm",
});
const projectType = await consola.prompt("Pick a project type.", {
type: "select",
options: [
"JavaScript",
"TypeScript",
{ label: "CoffeeScript", value: "CoffeeScript", hint: "oh no" },
],
initial: "TypeScript",
});
const tools = await consola.prompt("Select additional tools.", {
type: "multiselect",
required: false,
options: [
{ value: "eslint", label: "ESLint", hint: "recommended" },
{ value: "prettier", label: "Prettier" },
{ value: "gh-action", label: "GitHub Action" },
],
initial: ["eslint", "prettier"],
});
consola.start("Creating project...");
await new Promise((resolve) => setTimeout(resolve, 1000));
consola.success("Project created!");
}
main();