Skip to content

Latest commit

 

History

History
80 lines (51 loc) · 1.77 KB

File metadata and controls

80 lines (51 loc) · 1.77 KB

Node with Window

⚠️ Alpha — expect breaking changes.

A cross-platform windowing library for Node.js with an Electron-compatible API. Uses WPF + WebView2 on Windows, GTK 4 + WebKitGTK on Linux, and AppKit + WKWebView on macOS.

WPF Notepad Screenshot

GTK Notepad Screenshot

Cocoa Notepad Screenshot

Install

npm install @devscholar/node-with-window

On Windows, also download the WebView2 SDK DLLs:

node node_modules/@devscholar/node-with-window/scripts/webview2-install.js install

Quick start

Use nww-forge to scaffold a new app:

npx @devscholar/nww-forge init my-app
cd my-app
npm start

See docs/quick-start.md for a step-by-step guide.

Prerequisites

Windows

  • Node.js 18+
  • PowerShell 5.1
  • .NET Framework 4.8
  • WebView2 runtime (pre-installed on Windows 11; install from Microsoft on Windows 10)

Linux

  • Node.js 18+
  • GJS (GNOME JavaScript runtime)
  • GTK 4
  • WebKitGTK 6.0

These are typically pre-installed on Ubuntu 24.04 LTS / GNOME desktops. If missing:

sudo apt install gjs gir1.2-gtk-4.0 gir1.2-webkit-6.0

macOS

  • Node.js 18+
  • macOS 12+ (Monterey)

API

The API mirrors Electron — replace import ... from 'electron' with import ... from '@devscholar/node-with-window'.

Examples

See node-with-window-examples.

Developing

After making changes to node-with-window itself, rebuild:

cd node-with-window && npm run build