win-apps
v1.0.1
Published
Native Win32 GUI helpers for Node.js with ESM, CommonJS and TypeScript declaration support.
Readme
win-apps
win-apps is a native Win32 GUI helper library for Node.js, designed to build professional desktop applications with buttons, text controls, native event handling, and TypeScript-friendly exports.
Features
- Native Win32 window creation and message loop
- Button, label, edit, checkbox, radio, and group box helpers
- Control event registration and backend dispatch
- ESM and CommonJS entrypoints
- TypeScript declaration support
- Prettier formatting setup
Installation
npm install win-appsUsage (CommonJS)
const { BuildAppWindow, CreateButton, StartGuiLoop, Api } = require('win-apps');
const app = BuildAppWindow({ title: 'Win Apps Example', width: 900, height: 600, center: true });
CreateButton({
parent: app.hwnd,
controlId: 1001,
text: 'Click Me',
x: 20,
y: 20,
width: 140,
height: 32,
onClick: () => {
Api.MessageBoxW(app.hwnd, 'Hello from win-apps!', 'Native Dialog', 0);
}
});
StartGuiLoop();Usage (ESM)
import { BuildAppWindow, CreateButton, StartGuiLoop, Api } from 'win-apps';
const app = BuildAppWindow({ title: 'Win Apps ESM', center: true });
CreateButton({
parent: app.hwnd,
controlId: 2001,
text: 'Press Me',
x: 20,
y: 20,
width: 120,
height: 32,
onClick: () => {
Api.MessageBoxW(app.hwnd, 'ESM native UI works!', 'win-apps', 0);
}
});
StartGuiLoop();TypeScript Support
This package ships with TypeScript declarations and a ready-to-use tsconfig.json.
Development Scripts
npm run build- checks TypeScript definitionsnpm run format- formats repository files with Prettiernpm run lint- validates formatting
License
Apache-2.0
