UNPKG

wndkit

Version:

Native Windows desktop apps in Node.js

77 lines (54 loc) 1.58 kB
# WndKit Native Windows desktop apps in Node.js. No bloat. Just Win32 APIs. ```javascript const { Window, Button, Label, Application } = require("wndkit"); const win = new Window("Hello", 400, 200); const label = new Label(win, "Click the button", 50, 50, 300, 30); const button = new Button(win, "Click Me", 150, 100, 100, 30); button.on("click", () => (label.text = "Clicked!")); win.show(); Application.run(); ``` **Requirements:** - Windows 10/11 - Node.js 20+ Works out of the box on x64. Other architectures compile automatically on install. ### Window ```javascript const win = new Window(title, width, height); win.title = "New Title"; // read/write win.size = { width, height }; // read/write win.position = { x, y }; // read/write win.show(); win.hide(); win.on("close", callback); ``` ### Button ```javascript const btn = new Button(parent, text, x, y, width, height); btn.text = "New Text"; // read/write btn.on("click", callback); ``` ### Label ```javascript const lbl = new Label(parent, text, x, y, width, height); lbl.text = "New Text"; // read/write ``` ### TextBox ```javascript const txt = new TextBox(parent, text, x, y, width, height); txt.text = "Hello"; // read/write txt.multiline = true; // read/write ``` ### CheckBox ```javascript const chk = new CheckBox(parent, text, x, y, width, height); chk.checked = true; // read/write chk.on("click", callback); ``` ### Application ```javascript Application.run(); // Start message loop (required) ``` ## License MIT