8000 chore: add example for readme · unjs/consola@2bb5813 · GitHub 8000
[go: up one dir, main page]

Skip to content

Commit 2bb5813

Browse files
committed
chore: add example for readme
1 parent 817626f commit 2bb5813

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

examples/sample.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { consola } from "../src";
2+
3+
async function main() {
4+
consola.info("Using consola 3.0.0");
5+
consola.start("Building project...");
6+
consola.warn("A new version of consola is available: 3.0.1");
7+
consola.success("Project built!");
8+
consola.error(new Error("This is an example error. Everything is fine!"));
9+
await consola.prompt("Deploy to the production?", {
10+
type: "confirm",
11+
});
12+
}
13+
14+
main();

0 commit comments

Comments
 (0)
0