- Notifications
You must be signed in to change notification settings - Fork52
nwjs/npm-installer
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
An npm installer forNW.js.
Please go through theCHANGELOG 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 versions
to view the list of available versions.
For more options, see the Options table below.
Add a script in yourpackage.json
:
{"scripts": {"start":"nw /path/to/app" }}
Executingnpm start
runs the NW.js app. Omitting the file path makes NW.js check for valid project in current working directory. You can also callnw
directly from./node_modules/.bin/nw
.
import{findpath}from'nw';letpath=awaitfindpath();
import{findpath}from'nw';letpath=awaitfindpath('chromedriver',{flavor:'sdk'});
import{get}from'nw';awaitget({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 egfile:///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 bycommunity 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 usingnw 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.
About
npm installer for NW.js
Resources
License
Code of conduct
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.