UNPKG

askeroo

Version:

A modern CLI prompt library with flow control, history navigation, and conditional prompts

30 lines 776 B
#!/usr/bin/env node import { ask, spinner } from "../src/index.js"; function sleep(ms) { return new Promise((resolve) => setTimeout(resolve, ms)); } const flow = async () => { // Simple custom symbol example const job = await spinner("Loading...", { style: { symbol: "🚀", color: "cyan", }, submitDelay: 1000, }); await job.start(); await sleep(3000); await job.stop("Complete!", { color: "green", symbol: "✅" }); return "Done!"; }; (async () => { try { const result = await ask(flow); console.log("\nResult:", result); } catch (error) { console.error("Error:", error); process.exit(1); } })(); //# sourceMappingURL=spinner-symbol-simple.js.map