
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
An npm installer for NW.js.
Please go through the CHANGELOG carefully and choose the appropriate version. Bug fixes and feature updates are pushed to the repo periodically.
npm install -g nw
You might run into issues installing globally. Learn how to fix this
npm install --save-dev nw
npm install --save-dev nw@0.94.1-1
You may use
npm view nw versionsto view the list of available versions.
For more options, see the Options table below.
Add a script in your package.json:
{
"scripts": {
"start": "nw /path/to/app"
}
}
Executing npm start runs the NW.js app. Omitting the file path makes NW.js check for valid project in current working directory. You can also call nw directly from ./node_modules/.bin/nw.
import { findpath } from 'nw';
let path = await findpath();
import { findpath } from 'nw';
let path = await findpath('chromedriver', { flavor: 'sdk' });
import { get } from 'nw';
await get({
version: '0.14.7'
// other options
});
| Name | Type | Default | Description | CLI Usage | .npmrc Usage | .env Usage | Module Usage |
|---|---|---|---|---|---|---|---|
| version | string | "latest" | "stable" | "latest" | Runtime version | npm install --save-dev nw | `` | `` | get({ version: "latest" }) |
| flavor | "normal" | "sdk" | "normal" | Runtime flavor | npm install --save-dev nw@sdk | nwjs_build_type=sdk | export NWJS_BUILD_TYPE=sdk | get({ flavor: "sdk" }) |
| platform | "linux" | "osx" | "win" | <defaults to host platform> | Host platform | npm install --save-dev --nwjs-platform nw | nwjs_platform=linux | NWJS_PLATFORM=linux | get({ platform: "linux" }) |
| arch | "ia32" | "x64" | "arm64" | <defaults to architecture platform> | Host architecture | npm install --save-dev --nwjs-arch nw | nwjs_arch=x64 | NWJS_ARCH=x64 | get({ arch: "x64"}) |
| 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/ nw" | "https://dl.nwjs.io" | Download server (https and file system is supported, for eg file:///home/user/nwjs_cache) | npm install --save-dev --nwjs-urlbase=https://dl.nwjs.io | nwjs_urlbase=https://dl.nwjs.io | NWJS_URLBASE=https://dl.nwjs.io | get({ downloadUrl: "https://dl.nwjs.io"}) |
| cacheDir | string | ./node_modules/nw | Directory to cache NW binaries | npm install --save-dev --nwjs-cache-dir ./cache nw | nwjs_cache_dir=./cache | NWJS_CACHE_DIR=./cache | get({ cacheDir: "./cache" }) |
| sirDir | string | . | File path to NW.js project | nw . | `` | `` | get({ srcDir: "." }) |
| cache | boolean | true | If true the existing cache is used. Otherwise it removes and redownloads it. | npm install --save-dev --nwjs-cache=true nw | nwjs_cache=true | NWJS_CACHE=true | get({ cache: true }) |
| ffmpeg | boolean | false | If true the chromium ffmpeg is replaced by community version with proprietary codecs. | npm install --save-dev --nwjs-ffmpeg=true nw | nwjs_ffmpeg=true | NWJS_FFMPEG=true | get({ ffmpeg: true }) |
| nodeAddon | false | "gyp" | false | Download Node headers | npm install --save-dev --nwjs-native-addon=true nw | nwjs_native_addon=true | NWJS_NATIVE_ADDON=true | get({ nativeAddon: true }) |
| unref | boolean | false | Prevent the parent process from waiting for a given subprocess. This is useful if you're using nw package to call the executable and want to prevent zombie processes eating up memory. | npm install --save-dev --nwjs-unref=true nw | nwjs_unref=true | NWJS_UNREF=true | get({ unref: true }) |
| shaSum | boolean | true | If true, then shasums are verified. Otherwise, it is ignored. | npm install --save-dev --nwjs-shasum=true nw | nwjs_shasum=true | NWJS_SHASUM=true | get({ shaSum: true }) |
Note: While using the CLI interface, /path/to/project refers to options.srcDir in the JavaScript API or JSON object.
NW.js's code and this installer use the MIT license.
FAQs
An installer for NW.js
The npm package nw receives a total of 1,607 weekly downloads. As such, nw popularity was classified as popular.
We found that nw demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.