@devscholar/nww-forge
v0.0.1
Published
Build toolchain for node-with-window apps, inspired by Electron Forge
Readme
@devscholar/nww-forge
Build toolchain for node-with-window apps, inspired by Electron Forge.
Requirements
- Node.js 18+
- Windows: PowerShell 5.1, .NET Framework 4.8, WebView2 runtime
- Linux: GJS, GTK 4, WebKitGTK 6.0 (
sudo apt install gjs gir1.2-gtk-4.0 gir1.2-webkit-6.0)
Scaffold a new app
npx @devscholar/nww-forge init my-app
npx @devscholar/nww-forge init my-app --template=vanilla-tsThis creates a new directory, copies the template, runs npm install, and downloads WebView2 DLLs on Windows automatically.
Templates
| Name | Description |
|------|-------------|
| vanilla (default) | Plain JavaScript, no build step |
| vanilla-ts | TypeScript, compiled with esbuild |
Development
cd my-app
npm start # nww-forge startFor TypeScript projects, the main entry is compiled with esbuild before running.
Package & distribute
npm run package # nww-forge package → out/<name>-<platform>-<arch>/
npm run make # nww-forge make → out/make/<name>-<version>-<platform>-<arch>.zippackage creates a folder bundle containing:
- Bundled
main.js(via esbuild) @devscholar/node-with-windowand its runtime scripts/DLLslaunch.bat(Windows) /launch.sh(Linux) launcher script
make runs package first, then passes the output through each configured maker.
The default maker produces a .zip archive.
The target machine must have Node.js installed to run the bundled app.
Configuration
Create forge.config.js in your project root:
export default {
packagerConfig: {
name: 'My App',
executableName: 'my-app',
},
makers: [
{ name: '@nww-forge/maker-zip' },
],
};The forge field in package.json is also supported as an alternative.
CLI reference
nww-forge init [name] [--template=<template>]
nww-forge start [--runtime=node|bun|deno]
nww-forge package
nww-forge make
nww-forge publish (not yet implemented)Using as a local dev dependency
npm install --save-dev @devscholar/nww-forgeThen the nww-forge binary is available via npm run scripts without a global install.
