Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

npm installer for NW.js

License

NotificationsYou must be signed in to change notification settings

nwjs/npm-installer

Repository files navigation

An npm installer forNW.js.

npm

Install

Please go through theCHANGELOG 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 usenpm view nw versions to view the list of available versions.

For more options, see the Options table below.

Usage

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.

APIs

Find path to the NW.js binary:

import{findpath}from'nw';letpath=awaitfindpath();

Find the path to the chromedriver binary

import{findpath}from'nw';letpath=awaitfindpath('chromedriver',{flavor:'sdk'});

Download specific versions independant of installer version

import{get}from'nw';awaitget({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 egfile:///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 bycommunity 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 usingnw 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.

About

npm installer for NW.js

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors26


[8]ページ先頭

©2009-2025 Movatter.jp