Package detail

nw-builder

nwutils5.5kMIT4.13.16

Build NW.js desktop applications for MacOS, Windows and Linux.

NW.js, node-webkit, Desktop, Application

readme

nw-builder

npm Join the chat at https://gitter.im/nwjs/nw-builder

Build NW.js applications for Mac, Windows and Linux.

Major Features

  • Get, run or build applications.
  • Integrate FFmpeg community builds
  • Configure executable fields, icons and rename Helper apps
  • Downloading from mirrors

Table of Contents

Install

npm i -D nw-builder

Every NW.js release includes a modified Node.js binary at a specific version. It is recommended to install exactly that version on the host system. Not doing so may download ABI incompatible Node modules. Consult the NW.js versions manifest for what Node.js version to install. It is recommended to use a Node version manager (such as volta, n, nvm, or nvm-windows) to be able to easily install and switch between Node versions.

Usage

This package can be used via a command line interface, be imported as a JavaScript module, or configured via the Node manifest as a JSON object. If options are defined in Node manifest, then they will be used over options defined in CLI or JavaScript API.

CLI interface:

nwbuild --mode=build --glob=false --flavor=sdk --cacheDir=./node_modules/nw /path/to/project

Note: While using the CLI interface, /path/to/project refers to options.srcDir in the JavaScript API or JSON object.

ESM import:

import nwbuild from "nw-builder";

CJS import:

let nwbuild;
import("nw-builder")
  .then((moduleObject) => {
    nwbuild = moduleObject;
  })
  .catch((error) => {
    console.error(error);
  });

nwbuild({
  mode: "build",
  glob: false,
  flavor: "sdk",
  cacheDir: "./node_modules/nw",
  srcDir: "/path/to/project",
});

Node manifest usage:

{
    "nwbuild": {
      "mode": "build",
      "glob": false,
      "flavor": "sdk",
      "cacheDir": "./node_modules/nw",
      "srcDir": "/path/to/project"
    }
}

See nw-builder in action by building the demo application.

  1. git clone https://github.com/nwutils/nw-builder
  2. Run npm run demo:bld:linux && npm run demo:exe:linux to build and execute a Linux application.
  3. Run npm run demo:bld:osx && npm run demo:exe:osx to build and execute a MacOS application.
  4. Run npm run demo:bld:win && npm run demo:exe:win to build and execute a Windows application.

From here on we will show nw-builder functionality by using the JavaScript module. Please note that the same functionality applies when using a command line or manifest file.

Concepts

nw-builder can get, run and build NW.js applications. We refer to them as get, run and build modes.

Get Mode

By default you get the normal build of the latest NW.js release for your specific platform and arch. For more information, please refer to the API reference.

nwbuild({
  mode: "get"
});

Get the community built FFmeg which contains proprietary codecs. This options is disabled by default. Please read the license's constraints before enabling this option.

nwbuild({
  mode: "get",
  ffmpeg: true
});

Get Node headers if you have to rebuild Node addons.

nwbuild({
  mode: "get",
  nativeAddon: "gyp"
});

Run Mode

const nwProcess = await nwbuild({
  mode: "run",
  srcDir: "./app",
  glob: false,
});

Note: The nwProcess is a Node.js process

Build Mode

Build with defaults:

nwbuild({
  mode: "build",
});

Managed Manifest

You can let nw-builder manage your node modules. The managedManifest options accepts a boolean, string or object type. It will then remove devDependencies, autodetect and download dependencies via the relevant packageManager. If none is specified, it uses npm as default.

Setting it to true will parse the first Node manifest it encounters as the NW manifest.

nwbuild({
  mode: "build",
  managedManifest: true,
});

Setting it to a string implies that you are passing the file path to the NW manifest.

nwbuild({
  mode: "build",
  managedManifest: "./nw.js",
});

Setting it to a object implies you are directly passing the NW manifest as a JavaScript object.

nwbuild({
  mode: "build",
  managedManifest: {
    name: "nwdemo",
    main: "index.html"
  },
});

Rebuild Node addons

Currently this feature is disabled and it may be removed in the future.

It only builds node addons which have a binding.gyp file in the srcDir. There are plans to support nan, cmake, ffi and gn and auto rebuild native addons which are installed as node modules.

nwbuild({
  mode: "build",
  nodeAddon: "gyp",
});

We recommend rebuilding Node addons for NW.js via node-gyp if you are using NW.js v0.83.0 or above.

node-gyp rebuild --target=22.2.0 --nodedir=/path/to/nw/node/headers

NW.js's Node version should match the Node version on the host machine due to ABI differences in V8.

API Reference

Options

Name Type Default Description
mode `"get" \ "run" \ "build"` "build" Choose between get, run or build mode
version `string \ "latest" \ "stable"` "latest" Runtime version
flavor `"normal" \ "sdk"` "normal" Runtime flavor
platform `"linux" \ "osx" \ "win"` Host platform
arch `"ia32" \ "x64" \ "arm64"` Host architecture
downloadUrl `"https://dl.nwjs.io" \ "https://npm.taobao.org/mirrors/nwjs" \ https://npmmirror.com/mirrors/nwjs \ "https://github.com/corwin-of-amber/nw.js/releases/"` "https://dl.nwjs.io" Download server. Supports file systems too (for example file:///home/localghost/nwjs_mirror)
manifestUrl `"https://nwjs.io/versions.json" \ "https://raw.githubusercontent.com/nwutils/nw-builder/main/src/util/osx.arm.versions.json"` "https://nwjs.io/versions.json" Versions manifest
cacheDir string "./cache" Directory to cache NW binaries
cache boolean true If true the existing cache is used. Otherwise it removes and redownloads it.
ffmpeg boolean false If true the chromium ffmpeg is replaced by community version with proprietary codecs.
logLevel `"error" \ "warn" \ "info" \ "debug"` "info" Specify level of logging.
shaSum boolean true Flag to enable/disable shasum checks.
srcDir string "./" File paths to application code
argv string[] [] Command line arguments to pass to NW executable in run mode. You can also define these in chromium-args in NW.js manifest.
glob boolean true If true file globbing is enabled when parsing srcDir.
outDir string "./out" Directory to store build artifacts
managedManifest `boolean \ string \ object` false Managed manifest
nodeAddon `false \ "gyp"` false Rebuild Node native addons
zip `boolean \ "zip" \ "tar" \ "tgz"` false If true, "zip", "tar" or "tgz" the outDir directory is compressed.
app `LinuxRc \ WinRc \ OsxRc` Additional options for each platform. (See below.)

app configuration object

This object defines additional properties used for building for a specific platform. For each platform, pass an object with appropriate values:

Windows-specific options (WinRc)

Name Type Default Description
icon string undefined The path to the icon file. It should be a .ico file. (WARNING: Please define the icon in the NW.js manifest instead)
name string Value of name in NW.js manifest The name of the application
version string Value of version in NW.js manifest The version of the application
comments string undefined Additional information that should be displayed for diagnostic purposes.
company string Value of author in NW.js manifest Company that produced the file—for example, Microsoft Corporation or Standard Microsystems Corporation, Inc. This string is required.
fileDescription string Value of description in NW.js manifest File description to be presented to users. This string may be displayed in a list box when the user is choosing files to install. For example, Keyboard Driver for AT-Style Keyboards. This string is required.
fileVersion string Value of version or value of version in NW.js manifest Version number of the file. For example, 3.10 or 5.00.RC2. This string is required.
internalName string Value of name in NW.js manifest Internal name of the file, if one exists—for example, a module name if the file is a dynamic-link library. If the file has no internal name, this string should be the original filename, without extension. This string is required.
legalCopyright string undefined Copyright notices that apply to the file. This should include the full text of all notices, legal symbols, copyright dates, and so on. This string is optional.
legalTrademark string undefined Trademarks and registered trademarks that apply to the file. This should include the full text of all notices, legal symbols, trademark numbers, and so on. This string is optional.
originalFilename string Value of name option Original name of the file, not including a path. This information enables an application to determine whether a file has been renamed by a user. The format of the name depends on the file system for which the file was created. This string is required.
privateBuild string undefined Information about a private version of the file—for example, Built by TESTER1 on \TESTBED.
productName string name in NW.js manifest Name of the product with which the file is distributed. This string is required.
productVersion string Value of version in NW.js manifest Version of the product with which the file is distributed—for example, 3.10 or 5.00.RC2.
specialBuild string undefined Text that specifies how this version of the file differs from the standard version—for example, Private build for TESTER1 solving mouse problems on M250 and M250E computers.
languageCode number 1033 Language of the file, defined by Microsoft, see: https://learn.microsoft.com/en-us/openspecs/office_standards/ms-oe376/6c085406-a698-4e12-9d4d-c3b0ee3dbc4a

Linux-specific options (LinuxRc)

Name Type Description
name string Name of the application
genericName string Generic name of the application
noDisplay boolean If true the application is not displayed
comment string Tooltip for the entry, for example "View sites on the Internet".
icon string Icon to display in file manager, menus, etc. (WARNING: Please define the icon in the NW.js manifest instead)
hidden boolean TBD
onlyShowIn string[] A list of strings identifying the desktop environments that should display a given desktop entry
notShowIn string[] A list of strings identifying the desktop environments that should not display a given desktop entry
dBusActivatable boolean A boolean value specifying if D-Bus activation is supported for this application
tryExec string Path to an executable file on disk used to determine if the program is actually installed
exec string Program to execute, possibly with arguments.
path string If entry is of type Application, the working directory to run the program in.
terminal boolean Whether the program runs in a terminal window.
actions string[] Identifiers for application actions.
mimeType string[] The MIME type(s) supported by this application.
categories string[] Categories in which the entry should be shown in a menu
implements string[] A list of interfaces that this application implements.
keywords string[] A list of strings which may be used in addition to other metadata to describe this entry.
startupNotify boolean If true, it is KNOWN that the application will send a "remove" message when started with the DESKTOP_STARTUP_ID environment variable set. If false, it is KNOWN that the application does not work with startup notification at all.
startupWMClass string If specified, it is known that the application will map at least one window with the given string as its WM class or WM name hin
prefersNonDefaultGPU boolean If true, the application prefers to be run on a more powerful discrete GPU if available.
singleMainWindow string If true, the application has a single main window, and does not support having an additional one opened.

MacOS-specific options (OsxRc)

Name Type Description
name string The name of the application
icon string The path to the icon file. It should be a .icns file. (WARNING: Please define the icon in the NW.js manifest instead)
LSApplicationCategoryType string The category that best describes your app for the App Store.
CFBundleIdentifier string A unique identifier for a bundle usually in reverse DNS format.
CFBundleName string A user-visible short name for the bundle.
CFBundleDisplayName string The user-visible name for the bundle.
CFBundleSpokenName string A replacement for the app name in text-to-speech operations.
CFBundleVersion string The version of the build that identifies an iteration of the bundle.
CFBundleShortVersionString string The release or version number of the bundle.
NSHumanReadableCopyright string A human-readable copyright notice for the bundle.
NSLocalNetworkUsageDescription string A human-readable description of why the application needs access to the local network.

Guides

Get unofficial MacOS builds

If you're running older Apple machines, you can download the unofficial builds.

Note: You will have to manually remove quarantine flag.

sudo xattr -r -d com.apple.quarantine /path/to/nwjs.app
nwbuild({
  mode: "get",
  platform: "osx",
  arch: "arm64",
  downloadUrl: "https://github.com/corwin-of-amber/nw.js/releases/download",
  manifestUrl: "https://raw.githubusercontent.com/nwutils/nw-builder/main/src/util/osx.arm.versions.json",
});

Note: Community FFmpeg binaries may not be available for unofficial builds. You will have to rebuild them yourself.

Get binaries via mirrors

China mirror:

nwbuild({
  mode: "get",
  downloadUrl: "https://npm.taobao.org/mirrors/nwjs",
});

Singapore mirror:

nwbuild({
  mode: "get",
  downloadUrl: "https://cnpmjs.org/mirrors/nwjs/",
});

Let nw-builder manage your native addons

Note: this behaviour is buggy and quite limited. This guide is to show what will be possible in the coming minor releases.

nwbuild({
  mode: "build",
  managedManifest: true,
  nativeAddon: "gyp",
});

Contributing

External contributor

  • We use Conventional Commits style of commit messages.
  • On opening a new PR, the comments will guide you on how to construct the new PR.
  • Pull requests are squashed and merged onto the main branch.
  • PR title is used as commit's first line, PR description is used as commit body.
  • Only commit messages starting with fix, feat and chore are recognised by the Release Please bot.
  • Lint your code before commiting your change.
  • Add tests whenever possible.

Maintainer guidelines

  • Approve pull requests before merging.
  • Enforce conventional commits before merging pull requests.
  • A commit's first line should be formatted as <type>[optional scope]: <description>.
  • A commit's body should have a description of changes in bullet points followed by any links it references or issues it fixes or closes.
  • Google's Release Please Action is used to update the changelog, bump the package version and generate GitHub releases.
  • NPM Publish Action publishes to npm if there is a version bump.

Roadmap

Bugs

  • Managed Manifest is broken. If glob is disabled and srcDir has no package.json, build fails.
  • Add back error, info, warn and debug logs

Features

  • feat(get): support canary releases
  • feat(pkg): add AppImage installer
  • feat(pkg): add NSIS installer
  • feat(pkg): add DMG installer
  • feat(get): add Linux ARM unofficial support
  • feat(bld): add source code protection
  • feat(pkg): add code signing

Chores

  • chore(docs): don't store JSDoc definitions in typedefs - get's hard to understand during development.
  • chore: annotate file paths as fs.PathLike instead of string.
  • chore(bld): factor out core build step
  • chore(bld): factor out linux config
  • chore(bld): factor out windows config
  • chore(bld): factor out native addon
  • chore(bld): factor out compressing
  • chore(bld): factor out managed manifest
  • chore(bld): move .desktop entry file logic to create-desktop-shortcuts package

FAQ

License

MIT License.

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning using Conventional Commits.

Since v4.6.0, we have switched to automated releases and this file does not need to be manually updated.

4.13.16 (2025-07-07)

Bug Fixes

  • util: update getManifest return type and handle empty response (#1410) (c287c07)

4.13.15 (2025-07-07)

Bug Fixes

Chores

  • ci: enable continue-on-error for env job (b6ee211)
  • deps: bump davelosert/vitest-coverage-report-action from 2.8.2 to 2.8.3 in /.github/workflows in the gha group (#1398) (548d0e5)
  • deps: bump the npm group across 1 directory with 10 updates (#1409) (6dd0311)
  • deps: bump the npm group across 1 directory with 9 updates (#1404) (29204c1)
  • fix linting errors (a7f57ed)

4.13.14 (2025-05-14)

Bug Fixes

  • bld: disable rebuilding Node addons (464dca2)

Chores

  • ci: check for NPM_TOKEN in separate job (74ca486)
  • deps: bump the npm group across 1 directory with 4 updates (#1394) (560dd73)
  • docs: clarify addon rebuilding disabled (bb910e1)
  • docs: remove mention of rebuilding node addons (e3ae5b3)

4.13.13 (2025-05-07)

Bug Fixes

  • security: use execFileSync instead of execSync (48193f0)

4.13.12 (2025-05-06)

Bug Fixes

  • util: specify default values in CLI invocation (3b3799d)

Chores

  • ci: check if NPM_TOKEN exists as action step (6b7e64e)
  • ci: fail if NPM_TOKEN not set (84484a1)
  • ci: move NPM_TOKEN conditional inside action steps (ea6ea4c)
  • ci: set continue-on-error to false (3b9a8a2)
  • deps: bump davelosert/vitest-coverage-report-action from 2.8.1 to 2.8.2 in /.github/workflows in the gha group (#1388) (7a51dd4)
  • deps: bump the gha group across 1 directory with 2 updates (#1385) (2a98e27)
  • deps: bump the npm group across 1 directory with 6 updates (#1378) (5df5c51)
  • deps: bump the npm group across 1 directory with 8 updates (#1390) (a5ce5be)
  • deps: bump the npm group across 1 directory with 9 updates (#1386) (1f55773)
  • deps: bump vite from 6.2.2 to 6.2.3 in the npm_and_yarn group (#1377) (4f4379d)
  • deps: bump vite from 6.2.3 to 6.2.4 in the npm_and_yarn group (#1379) (e425d56)

4.13.11 (2025-03-19)

Bug Fixes

  • util: use strict boolean check for glob flag (63c931d)

Chores

  • ci: add concurrency (41494f5)
  • ci: do not run npm publish job if NPM_TOKEN is not available (e21051c)
  • deps: bump @babel/runtime from 7.26.0 to 7.26.10 in the npm_and_yarn group (#1373) (0b2d34e)
  • deps: bump actions/setup-node from 4.2.0 to 4.3.0 in /.github/workflows in the gha group (#1370) (5509ca9)
  • deps: bump the npm group across 1 directory with 5 updates (#1371) (ba554d2)

4.13.10 (2025-03-11)

Bug Fixes

  • ci: give release please write permissions (920e4a0)
  • codeql: address code scanning alerts (#1360) (10cb3ba)

Chores

  • deps: bump googleapis/release-please-action from 4.1.4 to 4.2.0 in /.github/workflows in the gha group across 1 directory (#1364) (0f28592)
  • deps: bump the npm group across 1 directory with 6 updates (#1368) (1aaffa5)

4.13.9 (2025-03-06)

Bug Fixes

  • get/verify: use crypto.timingSafeEqual to verify shasums (3dd449a)

Chores

  • deps: bump the gha group across 1 directory with 2 updates (#1358) (48e4947)
  • deps: bump the npm group across 1 directory with 13 updates (#1357) (9d3fe0c)
  • reverse undeprecation of get and run mode (e139740)

4.13.8 (2025-01-01)

Bug Fixes

Chores

  • deps: bump the npm group across 1 directory with 11 updates (#1332) (b9b96ff)
  • docs: clarify CJS usage (d673459), closes #1331
  • docs: clarify non-usage of srcDir in CLi interface (1b61bd1), closes #1330
  • docs: fix CJS import usage example (5f323df), closes #1331
  • test: download latest NW.js version for Linux demo app (8c09908), closes #1324

4.13.7 (2024-11-28)

Bug Fixes

  • get: use \s+ to split lines containing shasum info (64f5709), closes #1317

4.13.6 (2024-11-26)

Bug Fixes

  • bld: fs.promises.copyFile -> fs.promises.cp (c1909c7)

4.13.5 (2024-11-26)

Bug Fixes

  • util: validate windows options.app.* iff defined (8a65a6d)

4.13.4 (2024-11-26)

Bug Fixes

  • util: validate options.app.company iff defined (a273e23)

4.13.3 (2024-11-25)

Bug Fixes

  • bld: correct fs.promises.copyFile function call (63fd422)

4.13.2 (2024-11-25)

Bug Fixes

  • bld: parse options.app.icon correctly during build mode (bd0ef96)
  • bld: use fs.promises.copyFile to copy app files in build mode with glob enabled (e1843f0)

4.13.1 (2024-11-24)

Bug Fixes

  • run: return NW.js Node process during run mode from nwbuild function (fa94df2)
  • types: correct nwbuild function return type (b274d27)

4.13.0 (2024-11-24)

Features

  • get: add options.shaSum to enable/disable shasum checks (#1307) (98abcaf)

4.12.1 (2024-11-24)

Bug Fixes

  • util: correct Array.isArray usage (31c4132)

4.12.0 (2024-11-21)

Features

Bug Fixes

Chores

  • deps-dev: bump the npm group across 1 directory with 6 updates (#1301) (56c1192)
  • deps: bump cross-spawn from 7.0.3 to 7.0.6 (#1305) (2803af3)
  • deps: bump davelosert/vitest-coverage-report-action from 2.6.0 to 2.7.0 in /.github/workflows in the gha group (#1295) (23aaad8)
  • deps: bump davelosert/vitest-coverage-report-action from 2.7.0 to 2.8.0 in /.github/workflows in the gha group (#1303) (ceaf348)

4.11.6 (2024-11-01)

Bug Fixes

  • bld: set product_string property in manifest to rename MacOS Helper apps (#1290) (b1caad7), closes #1286

4.11.5 (2024-11-01)

Bug Fixes

Chores

  • deps-dev: bump nw from 0.92.0 to 0.93.0 in the npm group across 1 directory (#1289) (ed275ad)
  • deps: bump the gha group across 1 directory with 2 updates (#1285) (13081c9)
  • docs: clarify priority for defined options (#1281) (632db41), closes #1261
  • docs: improve terminology (84fa2a4)

4.11.4 (2024-10-13)

Bug Fixes

  • util: strip special and control characters from app.name (#1259) (b035bc3)

Chores

  • deps: bump actions/checkout from 4.2.0 to 4.2.1 in /.github/workflows in the gha group (#1273) (3165f2b)
  • deps: bump the npm group across 1 directory with 7 updates (#1275) (5f26f21)
  • deps: drop Dependabot support for v3 branch (19cf479)

4.11.3 (2024-10-02)

Bug Fixes

  • get: do not check integrity of community ffmpeg but give a warning (#1253) (0c05a34), closes #1209

4.11.2 (2024-10-02)

Bug Fixes

  • get: verify shasum for official ffmpeg not community ffmpeg (#1251) (9385836), closes #1209

4.11.1 (2024-10-01)

Bug Fixes

Chores

  • deps-dev: bump the npm group across 1 directory with 6 updates (#1250) (94da963)
  • deps: bump rollup from 4.22.1 to 4.22.4 (#1241) (6601ebc)
  • deps: bump the gha group across 1 directory with 2 updates (#1247) (526454e)

4.11.0 (2024-09-20)

Features

  • bld: add NSLocalNetworkUsageDescription option for MacOS (#1236) (eea3f69), closes #1235

Chores

  • bld: remove repetitive code for updating MacOS Helper apps (#1214) (e1edc05)
  • cli: migrate from yargs to commander (#1216) (7ca5a28)
  • deps: bump actions/setup-node from 4.0.3 to 4.0.4 in /.github/workflows in the gha group (#1232) (8473fc6)
  • deps: bump the npm group across 1 directory with 7 updates (#1233) (9efa2f4)
  • deps: bump vite from 5.3.5 to 5.4.6 (#1231) (6135682)

4.10.0 (2024-08-24)

Features

Chores

  • deps: bump davelosert/vitest-coverage-report-action from 2.5.0 to 2.5.1 in /.github/workflows in the gha group (#1210) (6d69ae3)
  • deps: bump the npm group across 1 directory with 3 updates (#1212) (20b7e81)
  • get: improve error message when comparing shasums (#1213) (b37068f), closes #1209
  • test: move tests to seperate dir (#1205) (da0e353)
  • test: rename fixtures dir (c6193bb)

4.9.0 (2024-08-15)

Features

Chores

  • deps: bump the npm group across 1 directory with 4 updates (#1199) (b07d1fc)
  • deps: bump volta-cli/action from 4.1.1 to 4.2.1 in /.github/workflows in the gha group across 1 directory (#1189) (282ea7a)
  • deps: remove license check logic (9dde7b2)

4.8.1 (2024-08-05)

Bug Fixes

  • bld: maintain cwd when using managedManifest or nativeAddon (#1187) (40223db), closes #1186

Chores

  • deps: bump the npm group across 1 directory with 6 updates (#1185) (f4c0822)
  • deps: remove unused cli-progress package (8f4e07d)

4.8.0 (2024-07-27)

Features

  • bld: add languageCode option for Windows (#1175) (96ad585)

Bug Fixes

  • bld: pass nw manifest correctly when managedManifest is true (#1176) (949c4b7)

Chores

  • ci: check for valid licenses (#1150) (ab99731)
  • deps: bump actions/setup-node from 4.0.2 to 4.0.3 in /.github/workflows in the gha group (#1151) (7130930)
  • deps: bump the npm group across 1 directory with 8 updates (#1177) (9410455)
  • deps: migrate from compressing to tar and archiver (7c73903)
  • docs: improve install/quick start (a87f44b)
  • fsm -> fs.promises (08d79bf)

4.7.8 (2024-07-02)

Chores

  • ci: add Vitest Coverage Action (#1136) (4d32845), closes #1041
  • deps-dev: bump eslint-plugin-jsdoc from 48.2.13 to 48.4.0 in the npm group (#1138) (61189de)
  • deps-dev: bump the npm group across 1 directory with 4 updates (#1142) (761963d)
  • deps: bump davelosert/vitest-coverage-report-action from 2.4.0 to 2.5.0 in /.github/workflows in the gha group (#1140) (fddaf9f)
  • test: enable vitest json reporter (e44aadb)

4.7.7 (2024-06-22)

Bug Fixes

  • execute postinstall script iff in development mode (#1132) (3c68216)

Chores

  • deps: bump the npm group across 1 directory with 6 updates (#1135) (905478a)

4.7.6 (2024-06-19)

Bug Fixes

Chores

  • deps-dev: bump @stylistic/eslint-plugin-js from 2.1.0 to 2.2.1 in the npm group (#1123) (fcd83a9)
  • deps-dev: bump ws from 8.17.0 to 8.17.1 (#1126) (7aa6f08)
  • deps: bump actions/checkout from 4.1.6 to 4.1.7 in /.github/workflows in the gha group (#1116) (eefde68)
  • test: enable e2e tests (#1120) (f802947)

4.7.5 (2024-06-11)

Bug Fixes

  • run: set stdio behaviour to inherit (a3d181a)

Chores

  • bld: migrate from rcedit with resedit (#1094) (03a55b9)
  • deps: bump actions/checkout from 4.1.5 to 4.1.6 in /.github/workflows in the gha group (#1095) (0f1b126)
  • deps: bump google-github-actions/release-please-action from 4.1.0 to 4.1.1 in /.github/workflows in the gha group (#1091) (316741b)
  • deps: bump googleapis/release-please-action from 4.1.1 to 4.1.3 in /.github/workflows in the gha group (#1114) (e284f5b)
  • deps: bump the npm group across 1 directory with 3 updates (#1112) (fde3491)
  • deps: bump the npm group across 1 directory with 6 updates (#1105) (eb63ded)
  • deps: upgrade to eslint v9 (ffe6dd0)
  • docs: add missing platform-specific app options info (#1093) (715097f)

4.7.4 (2024-05-12)

Bug Fixes

  • cli: add missing options managedManifest and nodeAddon (#1084) (f6ced81)

Chores

4.7.3 (2024-05-09)

Bug Fixes

4.7.2 (2024-05-09)

Bug Fixes

  • get: close file after reading all entries (#1077) (a6b090f)

Chores

  • ci: correct config hopefully (0bad4d2)
  • deps: bump the gha group in /.github/workflows with 2 updates (#1074) (fd8a633)
  • deps: bump the npm group across 1 directory with 11 updates (#1078) (7158c7b)
  • deps: bump vite from 5.1.6 to 5.2.8 (#1060) (c52dbb6)
  • docs: update contributing guidelines (efdbdca)

4.7.1 (2024-03-30)

Bug Fixes

Chores

  • deps: reconfigure dependabot (698ecd5)

4.7.0 (2024-03-26)

Features

  • get: support file:// for options.downloadUrl (094567c)

Chores

  • deps: bump follow-redirects from 1.15.5 to 1.15.6 (#1052) (8258de9)
  • deps: bump the gha group in /.github/workflows with 1 update (#1054) (1935800)
  • deps: bump the gha group in /.github/workflows with 2 updates (#1051) (0362403)
  • deps: bump the npm group with 1 update (#1055) (5a7bc71)
  • deps: bump the npm group with 3 updates (#1050) (a70aabc)
  • deps: bump the npm group with 8 updates (#1048) (0ca3c34)
  • get: deprecate get mode (#1053) (386fc18)

4.6.4 (2024-02-24)

Bug Fixes

  • get: copy ffmpeg to correct location on windows (#1044) (71fa4ab)

4.6.3 (2024-02-22)

Bug Fixes

Chores

  • docs: update contributing guidelines (ca594df)

4.6.2 (2024-02-22)

Bug Fixes

  • get: ffmpeg and symlinks (d5c1bf5)

Chores

  • deps: bump ip from 2.0.0 to 2.0.1 (2284d52)

4.6.1 (2024-02-15)

Chores

  • ci: add chores section to changelog (#1028) (d630720)
  • ci: fixup release please action (#1032) (f9ae7cd)
  • ci: remove schema prop (33238b1)
  • deps: bump the gha group in /.github/workflows with 1 update (70030df)
  • docs: update PR template to simplify commit descriptions (#1029) (6da9b89)
  • docs: update readme and changelog (63fd50b)
  • fix remaining lint errors (334ae74)
  • get: refactor implementation (#1025) (72f65e1)
  • get: refactor unzip symlink implementation (#1030) (69661c3)
  • get: simplify symlink logic (#1035) (4f64307), closes #1030
  • release-please-action: do not point to manifest file (96eeec8)
  • release-please-action: point to config and manifest (0a6a44d)
  • release-please: correct path to package (3719cee)
  • release-please: remove manifest (23a16fb)
  • run: mark run mode as deprecated (#1027) (1115728)
  • test: try adding chores to release notes (#1031) (5cabc20)

4.6.0 (2024-02-01)

Features

[Unreleased]

[4.5.4] - 2024-01-23

Changed

  • Migrate from unzipper to yauzl-promise to prevent corrupting files.

[4.5.3] - 2023-12-20

Changed

  • Wrap unzipper call inside Promise to prevent race condition.

[4.5.2] - 2023-12-19

Changed

  • Fix yargs/helpers import for cli usage.

[4.5.1] - 2023-12-19

Changed

  • Manually create symbolic links for MacOS builds.

[4.5.0] - 2023-12-18

Added

  • Use unzipper to decompress ZIP files.

Changed

  • Use tar to extract tarballs.
  • Disable options.nativeAddon.

Removed

  • Remove yauzl-promise since it does not preserve symlinks on MacOS.

[4.4.2-beta.4] - 2023-11-03

Changed

  • Use yauzl-promise to decompress MacOS build on MacOS platform.

Removed

  • Native package unzip usage.

[4.4.2-beta.3] - 2023-10-23

Added

  • Align cache implementation with nwjs/npm-installer
  • nw module can use the options.cacheDir to get cached NW.js binaries.

[4.4.2-beta.2] - 2023-10-20

Added

  • Node Native Addon support using GYP. To enable, set options.nativeAddon to gyp.

[4.4.2-beta.1] - 2023-10-16

Added

  • Managed Manifest mode. options.ManagedManifest defaults to false.
  • If true, then first package.json globbed is parsed as manifest.
  • If JSON type, object is parsed as manifest.
  • If string type, then resolve as file path to manifest.

[4.4.2] - 2023-10-16

Changed

  • Fix FFmpeg decompression.
  • Auto generate docs from JSDoc comments.
  • Improve TypeScript type definitions.
  • Fix get mode.
  • Refactor build mode.
  • Generate markdown docs from JSDocs.

[4.4.1] - 2023-09-06

Changed

  • Improve debug logging.
  • Fixed handling of argv.

[4.4.0] - 2023-09-05

Added

  • Cache community FFmpeg.
  • Move FFmpeg decompress function to relevant location

[4.3.11] - 2023-09-05

Changed

  • Separate download logic for NW.js and FFmpeg.

[4.3.10] - 2023-08-21

Removed

  • Do not copy the first package.json encountered to the root of options.outDir when options.glob is enabled. This may seem like a breaking change but it is actually reverting incorrect behaviour.

[4.3.9] - 2023-08-15

Changed

  • Some mac environments don't restore symlinks when using compressing lib. Now we will use system unzip command to extract zip files

[4.3.8] - 2023-08-14

Changed

  • Handle error during ffmpeg copy on some mac environments

[4.3.7] - 2023-08-11

Changed

  • Move community ffmpeg in the correct folder.

[4.3.6] - 2023-08-11

Changed

  • Move community ffmpeg in the correct folder.

[4.3.5] - 2023-08-03

Changed

  • Return promise in get mode to await it correctly.

[4.3.4] - 2023-08-02

Changed

  • Conditonally set Icon for Windows build.
  • Refactor get mode into a single file.

[4.3.3] - 2023-07-25

Changed

  • Set NSHumanReadableCopyright property in *.app/Resources/en.lproj/InfoPlist.strings to update copyright

Removed

  • NSHumanReadableCopyright from Info.plist

[4.3.2] - 2023-07-11

Added

  • Descriptions and argument types for remaining cli arguments.

[4.3.1] - 2023-07-07

Changed

  • Replace the icon at nwjs.app/Contents/Resources/app.icns with the icon at options.app.icon file path.

Removed

  • xattr package. The com.apple.quarantine flag should be handled by the developer.

[4.3.0] - 2023-07-03

Added

  • Compress outDir to zip, tar and tgz formats.
  • Specify log level via options.logLevel.
  • Add platform, arch, Node and NW.js info in debug log.
  • Add MacOS name, version, description and legal metadata
  • Removed redundant options.app.icon property (Refer to NW.js docs on how to set icon)

[4.2.8] - 2023-06-29

Changed

  • Refactor zip implementation. Use compressing instead of archiver package.
  • If zip is true or "zip", then remove outDir after compression. (This was supposed to be the intented behavior all along).

[4.2.7] - 2023-06-27

Changed

  • Redownload manifest.json every time the nwbuild function is executed.
  • If manifest.json already exists and we are unable to connect to the nwjs.io domain, then use the existing manifest.
  • If no manifest.json exists in the cache dir, then the validate function will cache this and throw an error - preventing the build.

[4.2.6] - 2023-06-20

Changed

  • Preserve relative symbolic links of NW.js files during build mode

[4.2.5] - 2023-06-20

Changed

  • Rename executable using options.app.name value.

[4.2.4] - 2023-06-18

Changed

  • Migrate from decompress to compressing

[4.2.3-beta.2] - 2023-06-16

Changed

  • Preserve relative symbolic links during build mode

[4.2.3-beta.1] - 2023-06-15

Changed

  • Do not resolve options.srcDir when parsing options object.

[4.2.3] - 2023-04-19

Changed

  • Fix module imports which broke in 04ccd51

[4.2.2] - 2023-04-14

Added

  • Validation for options.version.
  • Type definition file for nwbuild function.

[4.2.1] - 2023-03-28

Changed

  • Set files to options.srcDir if glob disabled preventing a package.json not found error.

[4.2.0] - 2023-03-27

Added

  • Glob flag defaulting to true. Currently file globbing is broken and it is recommended to set glob to false.

Changed

  • Fixed get mode
  • Fixed run mode
  • Fixed build mode
  • Updated get mode docs

[4.1.1-beta.2] - 2023-03-15

Changed

  • Parse the first package.json file and treat it as the NW.js manifest. Copy it to outDir/package.nw/package.json for Linux and Windows and outDir/nwjs.app/Contents/Resources/app.nw/package.json for MacOS.

To simplify your workflow, you can pass the path to the package.json first:

nwbuild ./path/to/package.json ./app/**/* ./node_modules/**/*

Make sure your manifest file's main property points to a valid file path. In this case it might be:

{
  "main": "app/index.html"
}

[4.1.1-beta.1] - 2023-03-14

Added

  • get mode to only download NW.js binaries. Example use case: download during Node's postinstall hook:
{
  "scripts": {
    "postinstall": "nwbuild --mode=get --flavor=sdk"
  }
}
  • Check if NW.js's Node version matches host's Node version

Changed

  • Fix undefined import for Windows configuration

[4.1.1-beta.0] - 2023-03-12

Changed

  • Remove false test for run mode.

[4.1.1] - 2023-03-12

Changed

  • Glob file and directory differently.
  • MacOS ARM build is no longer behind beta version.

[4.1.0-beta.3] - 2023-03-01

Added

  • Allow list https://npmmirror.com/mirrors/nwjs/ and https://npm.taobao.org/mirrors/nwjs/ mirrors.

[4.1.0-beta.2] - 2023-02-29

Changed

  • Do not convert srcDir files to absolute paths.
  • Copy files to correct location.

[4.1.0-beta.1] - 2023-02-28

Changed

  • Resolve path iff file path type is valid.

[4.1.0-beta.0] - 2023-02-25

Added

  • MacOS ARM support

[4.1.0] - 2023-02-23

Added

  • Use (community) prebuilt version of ffmpeg if the ffmpeg flag is true (defaults to false).

Changed

  • await platform specific config steps

[4.0.11] - 2023-02-5

Changed

  • Security update http-cache-semantics to v4.1.1.

[4.0.10] - 2023-02-05

Added

  • options.cli flag to prevent node-glob from globbing already globbed files and erroring out with a package.json not found in srcDir file glob patterns message.

Changed

  • Copy subdirectories of options.srDir in the correct location.

[4.0.9] - 2023-02-03

Added

  • Run and build demo app in CI.

Changed

  • Fixed false positives in CI
  • Throw errors instead of returning them
  • Reject error object instead of exit code

[4.0.8] - 2023-01-15

Added

  • Flag to check if specific nw release is cached. #772

Changed

  • Create cacheDir, outDir before getting release info. #772

[4.0.7] - 2023-01-14

Changed

  • Do not throw error if nwbuild is of object type. #769

  • Fix package.json path for updateNotifier. #767

[4.0.6] - 2023-01-09

Added

  • Warn about loss of permissions if building Linux or MacOS on Windows. 8793d4b

Changed

  • Fix error when options.version is latest. 33ef184

Removed

[4.0.5] - 2023-01-06

Changed

  • Prevent duplicate globbing of srcDir files. 07901c9

[4.0.4] - 2023-01-06

Changed

  • Convert srcDir type from string[] to string. 1a699af

[4.0.3] - 2023-01-06

Added

  • File globing. #749

  • Linux and Windows configuration options. #729

Changed

  • Skip modification of Windows executable if platform is not Windows or Wine is not installed. #739

  • Run mode should only require srcDir, version and flavor. #718

[4.0.2] - 2022-11-30

Added

  • Allow user to rename NW executable. #712

Changed

  • Fix MacOS build. #717

  • CJS support via esbuild. #713

[4.0.1] - 2022-11-20

Added

  • Support for Desktop Entry file. #690

Changed

  • Resolve promise in close event with respect to compression. #698

  • Check for release info after downloading NW binaries in cacheDir. #697

[4.0.0] - 2022-11-16

Added

  • Rename Helper apps. #687

  • MacOS support. #685

  • Check for nwbuild object in package.json. #684

[3.8.6] - 2022-09-22

  • Fix mac and windows build

[3.8.5] - 2022-09-20

Added

  • nwbuild function which accidently got removed.

Changed

  • Update usage docs for nwbuild

[3.8.4] - 2022-09-20

Changed

  • Refactor download function

[3.8.3-beta.1]

Changed

  • Check for first instance of package.json

[3.8.3] - 2022-08-26

Changed

  • platforms argument also accepts comma separated (without spaces) values

[3.8.2] - 2022-08-08

Added

  • Support for multiple file paths

[3.8.1] - 2022-07-18

Changed

  • Fix regex to match package.json files only

[3.8.0] - 2022-07-11

Added

  • mode option which defaults to run
  • nwbuild function
  • quiet option to documentation

Changed

  • CLI options by matching them to the API

[3.7.4] - 2022-06-06

Removed

  • Remove Version from CFBundleShortVersionString #576

[3.7.2] - 2022-06-02

Added

  • Added options buildType, macCredits, macPlist, zip, zipOptions to CLI #575

Changed

  • Update lint command #575

[3.7.1] - 2022-06-02

Changed

  • Add EditorConfig #574
  • Fix build step for Windows x64 platform #572
  • Refactor platforms object #571

[3.7.0] - 2022-05-30

Added

  • Optional zip file merging for Windows and Linux #567
  • Add code of conduct #560

Changed

  • Update contributing guide #569
  • Switch from TypeScript to JSDocs #568
  • Set window icon with rcedit #566
  • Refactor checkCache #565
  • Simplify demo
  • Refactor detectCurrentPlatform #564
  • Update dependencies #561 #532

Removed

[3.6.0] - 2022-05-18

Added

  • GitHub Actions for CICD #552
  • Support multiple locales on OSX #389
  • Pull request and issue template #553

Changed

  • Dependencies #550
  • Documentation #540 #553 #555
  • Improve run mode by detecting current platform to prevent downloading additional binaries

Removed

  • Travis
  • AppVeyor
  • JSHint
  • EditorConfig

[3.5.7]

Security

[3.5.1] - 2017-10-19

Added

Fixed

[3.4.1] - 2017-06-05

Removed

  • The bluebird dependency. We're now using native promises instead.

[3.4.0] - 2017-05-28

Added

  • If using the package programmatically and it's out of date, a message will be shown (this was always the case for the CLI).
  • There is now a README in every directory (with at least a single sentence summarizing the directory) to help with onboarding contributors.

Changed

  • Some dependencies are updated.

Removed

  • osx32 is removed from the default list of platforms. Thanks to @preaction (PR #439).
  • An unnecessary rcedit dependency is removed.

Fixed

  • For Node 7+ users, you won't see a os.tmpDir deprecation warning anymore.

Old format

  • 2017-05-22 3.2.3 Fix for caching when a version is specified (thanks @piwonesien for the help).
  • 2017-05-20 3.2.2 Fix: when using the nwbuild in run mode, the -p option was ignored and the current platform was always used.
  • 2017-05-16 3.2.1 Fix: NW.js 0.22.0+ apps didn't open.
  • 2017-02-12 3.2.0 Defaults to HTTPS now, added manifestUrl option, and bumped some dependencies.
  • 2016-10-09 3.1.2 Fix for passing array as files option when running app (plus some security fixes).
  • 2016-10-09 3.1.1 Fix for flavor feature when using CLI.
  • 2016-09-14 3.1.0 Ability to select any flavor of NW.js, not just sdk.
  • 2016-08-28 3.0.0 bumping graceful-fs-extra dependency to 2.0.0.
  • 2016-08-14 2.2.7 fix for macIcns option when using NW.js 0.12.3
  • 2016-07-31 2.2.6 fix for OS X caching
  • 2016-07-03 2.2.5 fix for update-notifier usage in bin
  • 2016-07-03 2.2.4 fix for syntax error in CLI
  • 2016-07-02 2.2.3 a few small fixes for the run option and more
  • 2016-07-02 2.2.2 fix for cache check of some legacy versions
  • 2016-07-02 2.2.1 supports newer NW.js versions (via http://nwjs.io/versions.json), plus other fixes.
  • 2015-12-18 2.2.0 added zip option.
  • 2015-12-06 2.1.0 added cacheDir command-line option, fix for no info being passed back, etc.
  • 2015-06-28 2.0.2 put upper bound to semver check for windows.
  • 2015-06-14 2.0.1 safer validation of versions.
  • 2015-06-14 2.0.0 changed to nw-builder, etc.
  • 2015-05-05 1.0.12 when using latest NW.js version, it's first validated that it's not an alpha version (fixes #222). Plus a fix for the winIco & macIcns command line options
  • 2015-01-29 1.0.8 fixed EMFILE errors (see #147 #148)
  • 2015-01-21 1.0.7 fixed about screen when copyright is not supplied
  • 2015-01-15 1.0.6 fixed downloads for nw.js version 0.12.0-alpha1
  • 2015-01-15 1.0.5 fixed downloads for NW.js versions < 0.12.0-alpha
  • 2014-12-12 1.0.0 64-bit support, improved platform-overrides and no more EMFILE errors.
  • 2014-12-07 0.4.0 macPlist CFBundleIdentifier is generated from package.json (see #131)
  • 2014-11-14 0.3.0 macPlist option improvements (see #96)
  • 2014-10-30 0.2.0 adds support for platform-specific manifest overrides (see #94)
  • 2014-08-19 0.1.2 adds a progress bar to downloads, fixes downloading through a proxy, fixed winIco, bug fixes
  • 2014-08-01 0.1.0 use app filename for generated executables, optimized version checking, (known issue: winIco on windows)
  • 2014-07-31 0.0.4 fixed compatibility with nodewebkit 0.10.0
  • 2014-04-20 Added run option, bug fixes
  • 2014-04-13 Preview Release