mirror of
https://github.com/zhigang1992/widowmaker.git
synced 2026-01-12 16:52:35 +08:00
master
Widowmaker
Server side driven UI
// Node code running in backend:
const startWidowmaker = require("@zhigang1992/widowmaker").default;
startWidowmaker(async w => {
w.show("Hello, what is your name?");
const name = await w.ask("Name", "Sup");
w.show(`Hi, ${name}, nice to meet you`);
w.show("Are you a boy or girl?");
const gender = await w.askCommands({
boy: "I'm a Boy",
girl: "I'm a Girl"
});
if (gender === "boy") {
w.display(
"https://storage.needpix.com/rsynced_images/comic-characters-2023311_1280.png"
);
} else {
w.display(
"https://storage.needpix.com/rsynced_images/woman-1467853_1280.png"
);
}
});
You can run anything in node here (e.g. puppeteer task login user) interactively
It supports:
- Show text
- Show image
- Show table
- Ask text
- Multi Choice
- Upload file
- Download file
More details here UIExplore.ts
It also has full TypeScript support!
Description
Languages
TypeScript
88.2%
HTML
6.3%
CSS
5.5%