evw (aka. event &workflow) is a library for building event-driven application in JavaScript/TypeScript.
- designed for cross-JavaScript runtimes (Node.js, Electron, Browser, Cloudflare Worker, Bun, Deno...)
- minimal core API
- written in TypeScript, 100% type and test coverage
npm i evw// @file: events.ts
import { defineEvent } from "evw";
export const storeDBEvent = defineEvent<{
content: string;
}>();// @file: main.ts
import { storeDBEvent } from "./events";
import { ipcMain } from "evw/electron";
ipcMain.on(storeDBEvent, (event, data) => {
console.log("Received data from web:", data.content);
});// @file: app.tsx
import { storeDBEvent } from "./events";
import { sendEvent } from "evw/electron";
export const App = () => {
const handleClick = () => {
sendEvent(storeDBEvent, { content: "Hello from Web!" });
};
return (
<div>
<button onClick={handleClick}>Send Message to Electron</button>
</div>
);
};MIT