微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

NW.js Web 调用 Node 模块

程序名称:NW.js

授权协议: MIT

操作系统: 跨平台

开发语言: JavaScript

NW.js 介绍

NW.js 可以让你直接在 DOM 上调用所有 Node.js 模块,相当于使用一种新的方法来编写 Web 应用。NW.js 的前身是 node-
webkit

特性:

演示程序:https://github.com/zcbenz/nw-sample-apps

示例:

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",
  "main": "index.html"
}

运行:

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

NW.js 官网

http://nwjs.io/

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐