加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 创业 > C语言 > 正文

window下nw小试牛刀

发布时间:2020-12-15 00:43:11 所属栏目:C语言 来源:网络整理
导读:首先直接到下载nw. 如果不知道nw是什么,就需要先脑补下: 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 enab

首先直接到下载nw. 如果不知道nw是什么,就需要先脑补下:
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.(摘自 github)

1,npm install -g nw或者下载后直接解压,会在nwjs-v0.13.x-win-xx目录下看到nw.exe,然后环境变量中,在path中增加nw的目录,然后在命令行运行nw,正常会出现一个window窗口,表示安装成功

2,参考nw githhub的文档,建立demo目录,并创建package.json文件,内容如下
{
"name": "demo",// 这个名称要和目录同名
"version": "0.0.1",
"main": "index.html"
"window": {

 "toolbar": false   //这个地方没出来,不知道什么原因

}
}
3,创建 main对应的 index.html



Hello World!


Hello World!

We are using node.js .




4,在命令行demo目录下命令行执行 winrar a ./demo.zip ./. (环境变量中,在path中增加winrar的目录)

5,在命令行执行nw demo.zip,就可以看到hello world了。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读