Socket
Book a DemoInstallSign in
Socket

nw

Package Overview
Dependencies
Maintainers
4
Versions
718
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nw

An installer for NW.js

latest
Source
npmnpm
Version
0.105.0
Version published
Weekly downloads
1.9K
-14.13%
Maintainers
4
Weekly downloads
 
Created
Source

nw

An npm installer for NW.js.

npm

Install

Please go through the CHANGELOG carefully and choose the appropriate version. Bug fixes and feature updates are pushed to the repo periodically.

Latest version globally

npm install -g nw

You might run into issues installing globally. Learn how to fix this

Latest version of normal build flavor:

npm install --save-dev nw

Specific version with changes to installer:

npm install --save-dev nw@0.94.1-1

You may use npm view nw versions to view the list of available versions.

For more options, see the Options table below.

Usage

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.

APIs

Find path to the NW.js binary:

import { findpath } from 'nw';
let path = await findpath();

Find the path to the chromedriver binary

import { findpath } from 'nw';
let path = await findpath('chromedriver', { flavor: 'sdk' });

Download specific versions independant of installer version

import { get } from 'nw';

await get({
  version: '0.14.7'
  // other options
});

Options:

NameTypeDefaultDescriptionCLI Usage.npmrc Usage.env UsageModule Usage
versionstring | "latest" | "stable""latest"Runtime versionnpm install --save-dev nw````get({ version: "latest" })
flavor"normal" | "sdk""normal"Runtime flavornpm install --save-dev nw@sdknwjs_build_type=sdkexport NWJS_BUILD_TYPE=sdkget({ flavor: "sdk" })
platform"linux" | "osx" | "win"<defaults to host platform>Host platformnpm install --save-dev --nwjs-platform nwnwjs_platform=linuxNWJS_PLATFORM=linuxget({ platform: "linux" })
arch"ia32" | "x64" | "arm64"<defaults to architecture platform>Host architecturenpm install --save-dev --nwjs-arch nwnwjs_arch=x64NWJS_ARCH=x64get({ 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.ionwjs_urlbase=https://dl.nwjs.ioNWJS_URLBASE=https://dl.nwjs.ioget({ downloadUrl: "https://dl.nwjs.io"})
cacheDirstring./node_modules/nwDirectory to cache NW binariesnpm install --save-dev --nwjs-cache-dir ./cache nwnwjs_cache_dir=./cacheNWJS_CACHE_DIR=./cacheget({ cacheDir: "./cache" })
sirDirstring.File path to NW.js projectnw .````get({ srcDir: "." })
cachebooleantrueIf true the existing cache is used. Otherwise it removes and redownloads it.npm install --save-dev --nwjs-cache=true nwnwjs_cache=trueNWJS_CACHE=trueget({ cache: true })
ffmpegbooleanfalseIf true the chromium ffmpeg is replaced by community version with proprietary codecs.npm install --save-dev --nwjs-ffmpeg=true nwnwjs_ffmpeg=trueNWJS_FFMPEG=trueget({ ffmpeg: true })
nodeAddonfalse | "gyp"falseDownload Node headersnpm install --save-dev --nwjs-native-addon=true nwnwjs_native_addon=trueNWJS_NATIVE_ADDON=trueget({ nativeAddon: true })
unrefbooleanfalsePrevent 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 nwnwjs_unref=trueNWJS_UNREF=trueget({ unref: true })
shaSumbooleantrueIf true, then shasums are verified. Otherwise, it is ignored.npm install --save-dev --nwjs-shasum=true nwnwjs_shasum=trueNWJS_SHASUM=trueget({ shaSum: true })

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

License

NW.js's code and this installer use the MIT license.

Keywords

nw

FAQs

Package last updated on 25 Oct 2025

Did you know?

Socket

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.

Install

Related posts