2019-10-28 15:01:17 +08:00
2019-10-28 14:14:06 +08:00
2019-10-28 15:00:21 +08:00
2019-10-28 13:53:49 +08:00
2019-10-28 14:14:06 +08:00
2019-10-28 15:01:17 +08:00

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
No description provided
Readme 229 KiB
Languages
TypeScript 88.2%
HTML 6.3%
CSS 5.5%