NW.js

直接从 DOM/WebWorker 中调用所有 Node.js 模块,实现用所有 Web 技术编写应用的新方式。「Call all Node.js modules directly from DOM/WebWorker and enable a new way of writing applications with all Web technologies.」

Github stars Tracking Chart

node-webkit 改名为 NW.js

官方网站:https://nwjs.io

简介

NW.js 是一个基于 Chromium 和 node.js 的应用运行时。你可以用 NW.js 来编写 HTML 和 JavaScript 的原生应用。它还可以让你直接从 DOM 中调用 Node.js 模块,实现了用所有 Web 技术编写原生应用程序的新方式。

它是在英特尔开源技术中心创建的。

用 NW.js 构建跨平台桌面应用程序
使用 node-webkit 创建桌面应用程序
使用 node-webkit 将 WebApp 转换为 DesktopApp(幻灯片)
关于项目的历史和内部结构的论文

特性:

  • 使用现代 HTML5、CSS3、JS 和 WebGL 编写的应用程序。
  • 完全支持 Node.js APIs 及其所有第三方模块
  • 良好的性能:Node 和 WebKit 在同一个线程中运行:函数调用简单明了;对象在同一个堆中,可以互相引用。
  • 易于打包和分发应用程序。
  • 可在 Linux,Mac OS X 和 Windows 上使用。

下载

演示和实际应用

你可能也会对 我们的 demos 仓库使用 nw.js 的应用程序和公司列表感兴趣。

快速入门

创建 index.html:

<!DOCTYPE html>
<html>
  <head>
    <title>Hello World!</title>
  </head>
  <body>
    <h1>Hello World!</h1>
    We are using node.js <script>document.write(process.version)</script>.
  </body>
</html>

创建 package.json:

{
  "name": "nw-demo",
  "version": "0.0.1",
  "main": "index.html"
}

运行

$ /path/to/nw . (假定当前目录包含 'package.json')

注意:在 Windows 上,你可以将包含 package.json 的文件夹拖到 nw.exe 中打开它。

注意:在 OSX 上,可执行的二进制文件在 .app 文件的一个隐藏目录中。要在 OSX 上运行 node-webkit,请键入:/path/to/nwjs。

/path/to/nwjs.app/Contents/MacOS/nwjs . (假设当前目录包含'package.json')

文档

正式文件:http://docs.nwjs.io/

有关如何编写/打包/运行应用程序的更多信息,请参阅。

还有我们的Wiki,可以了解更多。

社区

我们使用 google 群组 作为我们的邮件列表(只使用英文)。通过 nwjs-general+subscribe@googlegroups.com 订阅。

注意:链接到旧的 google 群组(例如 https://groups.google.com/forum/#!msg/node-webkit/doRWZ07LgWQ/4fheV8FF8zsJ)的链接不再工作,可以通过将 node-webkit 替换为 nwjs-general(例如 https://groups.google.com/forum/#!msg/nwjs-general/doRWZ07LgWQ/4fheV8FF8zsJ)来解决。

问题正在 GitHub 上进行跟踪。

NW.js 的源代码和日常开发跨越了这个组织中的多个存储库。这个仓库是为了问题跟踪,登陆页面和部分源代码。

验证二进制文件

从 0.32.0 开始,稳定版和夜间版下载目录包含一个 SHASUMS256.txt 文件,其中列出了每个可供下载的文件的 SHA 校验和,以及下载包内文件的校验和。

SHASUMS256.txt 文件可以用 curl 下载。

$ curl -O https://dl.nwjs.io/vx.y.z/SHASUMS256.txt

要检查下载的文件是否符合校验和,可以用 sha256sum 命令来运行它,如

$ grep nwjs-vx.y.z.tar.gz SHASUMS256.txt | sha256sum -c -

稳定版 (但不是 Nightlies) 也有 SHASUMS256.txt 的 GPG 分离签名,即 SHASUMS256.txt.asc。你可以使用 gpg 来验证 SHASUMS256.txt 是否被篡改。

要验证 SHASUMS256.txt 没有被篡改,首先需要导入 NW.js 维护者的 gpg 密钥来创建发布。使用这个命令来导入密钥。

$ gpg --keyserver pool.sks-keyservers.net --recv-keys 78680FA9E21BB40A
(Key fingerprint is 1E8B EE8D 5B0C 4CBC D6D1  9E26 7868 0FA9 E21B B40A)

接下来,下载该版本的 SHASUMS256.txt.asc。

$ curl -O https://dl.nwjs.io/vx.y.z/SHASUMS256.txt.asc

在下载了相应的 SHASUMS256.txt 和 SHASUMS256.txt.asc 文件后,你可以使用 gpg --verify SHASUMS256.txt.asc SHASUMS256.txt 来验证该文件是否已经被 NW.js 团队的授权成员签署。

一旦验证完毕,使用 SHASUMS256.txt 文件来获取上述二进制验证命令的校验和。

许可证

NW.js 的代码在这个 repo 中使用 MIT 授权,请看我们的 LICENSE 文件。要重新发布二进制文件,请看如何打包和发布你的应用程序


(The second edition revised by vz on 2020.09.26)

Overview

Name With Ownernwjs/nw.js
Primary LanguageJavaScript
Program languageC++ (Language Count: 10)
PlatformLinux, Mac, Windows
License:MIT License
Release Count345
Last Release Namenw-v0.87.0 (Posted on )
First Release Namev0.2.0 (Posted on )
Created At2012-01-04 06:21:10
Pushed At2024-04-30 23:54:10
Last Commit At2016-02-19 11:12:09
Stargazers Count40.1k
Watchers Count1.6k
Fork Count3.9k
Commits Count5.2k
Has Issues Enabled
Issues Count7296
Issue Open Count915
Pull Requests Count573
Pull Requests Open Count10
Pull Requests Close Count255
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

node-webkit is renamed NW.js

Gitter
Official site: https://nwjs.io

Introduction

NW.js is an app runtime based on Chromium and node.js. You can
write native apps in HTML and JavaScript with NW.js. It also lets you
call Node.js modules directly from the DOM and enables a new way of writing
native applications with all Web technologies.

It was created in the Intel Open Source Technology Center.

Building a Cross-platform Desktop App with NW.js
Creating Desktop Applications With node-webkit
WebApp to DesktopApp with node-webkit (slides)
Essay on the history and internals of the project

Features

  • Apps written in modern HTML5, CSS3, JS and WebGL.
  • Complete support for Node.js APIs and all its third party modules.
  • Good performance: Node and WebKit run in the same thread: Function calls are made straightforward; objects are in the same heap and can just reference each other.
  • Easy to package and distribute apps.
  • Available on Linux, Mac OS X and Windows.

Downloads

Demos and real apps

You may also be interested in our demos repository and the List of apps and companies using nw.js.

Quick Start

Create index.html:

<!DOCTYPE html>
<html>
  <head>
    <title>Hello World!</title>
  </head>
  <body>
    <h1>Hello World!</h1>
    We are using node.js <script>document.write(process.version)</script>.
  </body>
</html>

Create package.json:

{
  "name": "nw-demo",
  "version": "0.0.1",
  "main": "index.html"
}

Run:

$ /path/to/nw .  (suppose the current directory contains 'package.json')

Note: on Windows, you can drag the folder containing package.json to nw.exe to open it.

Note: on OSX, the executable binary is in a hidden directory within the .app file. To run node-webkit on OSX, type:
/path/to/nwjs.app/Contents/MacOS/nwjs . (suppose the current directory contains 'package.json')

Documents

Official documentation: http://docs.nwjs.io/

For more information on how to write/package/run apps, see:

And our Wiki for much more.

Community

We use the google group as
our mailing list (use English only). Subscribe via nwjs-general+subscribe@googlegroups.com.

NOTE: Links to the old google group (e.g. https://groups.google.com/forum/#!msg/node-webkit/doRWZ07LgWQ/4fheV8FF8zsJ) that are no longer working can be fixed by replacing node-webkit with nwjs-general (e.g https://groups.google.com/forum/#!msg/nwjs-general/doRWZ07LgWQ/4fheV8FF8zsJ).

Issues are being tracked here on GitHub.

The source code for NW.js and the daily development spans across multiple repositories in this organization. This repository is for the purpose of issue tracking, landing page and part of the source code.

Verifying Binaries

Starting from 0.32.0 the stable and nightly download directories contain a SHASUMS256.txt
file that lists the SHA checksums for each file available for download, as well as the
checksums for the files inside the download package.

The SHASUMS256.txt can be downloaded using curl.

$ curl -O https://dl.nwjs.io/vx.y.z/SHASUMS256.txt

To check that a downloaded file matches the checksum, run
it through sha256sum with a command such as:

$ grep nwjs-vx.y.z.tar.gz SHASUMS256.txt
To the top