NW.jsWeb 调用 Node 模块
NW.js 可以让你直接在 DOM 上调用所有 Node.js 模块,相当于使用一种新的方法来编写 Web 应用。NW.js 的前身是 node-webkit 。
特性:
使用 HTML5、CSS3、JS 和 WebGL 编写应用
完全支持 Node.js APIs 以及其 第三方模块
性能表现良好,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')
评论
源码分析 Node 的 Cluster 模块
作者 | uerwtoy来源 | yq.aliyun.com/articles/717323前段时间,公司的洋彬哥老哥遇到一个问题,大概就是本机有个node的http服务器,但是每次请求这个服务器的端口返回的数据都报错,一看返回的数据根本不是http的报...
程序员成长指北
0
Node 中如何引入一个模块及其细节
在 node 环境中,有两个内置的全局变量无需引入即可直接使用,并且无处不见,它们构成了 nodejs 的模块体系: module 与 require。以下是一个简单的示例const fs = require('fs')const add = (x, y) => x + ymodul...
前端劝退师
0
Node Info
NodeInfo是一个简单的中间件,它能给代码环境提供以下功能:基本的代码环境信息,比如节点版本、CPU、内存和平台所有已经安装的节点程序包此外,还提供了其他包信息,例如作者、URL等
Node Info
0