Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use node-webkit

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Today, I would like to share with you the relevant knowledge of how to use node-webkit. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.

"node-webkit" is an application running environment based on "node.js" and chromium; this environment can package web applications built on browsers and "node.js" into desktop applications, that is, using HTML, css and JavaScript to write PC desktop applications.

This article operating environment: Windows10 system, nodejs version 12.19.0, Dell G3 computer.

What is node-webkit?

Node-webkit is an application running environment based on node.js and chromium, through which we can package web applications built on chrome browsers and node.js into desktop applications, and can also be cross-platform. Obviously, compared with traditional desktop applications, web applications developed with html5+css3+js in some specific areas are simpler and more efficient, and can also use the functions of node.js, so node-webkit is still very useful. It enables programmers who only know javaScript and HTML to develop desktop applications, and it is open source.

In other words, we can implement a localized application through HTML,CSS,JavaScript. The most creative part of the project is the integration of node.js, which enables application developers to use node.js modules directly in DOM, which greatly enhances the ability of JavaScript on the Web side. The project is developed and maintained by the Intel Open Source Project Center.

In fact, it can be understood as writing web app. However, you can use node.js 's api and finally package and publish the entire application with a browser. So it is not limited by the platform (except for using node.js to call the operating system api), a piece of code can be packaged and published on the corresponding platform, assuming you have known about phonegap/cordova. This node-webkit is very similar to them. Just an extra piece of node.js.

Here is the operation flow of developing a project using node-webkit.

Download node-webkit

Download the files for the corresponding operating system at https://github.com/rogerwang/node-webkit. Just decompress it. It is recommended that you add it to the environment variable.

New project

Create a new project folder. C:/Users/keith/node/webkitdemo

Create a new package.json

Hello World! Hello Node-webkit Node.js version: [xss_clean] (process.version).

Running

Under the command line:

Npm install node-webkit-builder-g cd C:/Users/keith/node/ nwbuild-p win C:/Users/keith/node/webkitdemo/ cd build/demo/win/. / demo.exe / / run the program

At this point, you can choose to compress and publish the compiled folder directly, or you can choose to package the compiled folder into an exe file and publish the exe file directly. If you want to do so, you need a tool Enigma Virtual Box, and run Enigma virtual box after installation.

Select the C:/Users/keith/node/build/win/demo.exe file in Enter Input File Name, then click the add button below to add all the dll files and nw.pak under the C:/Users/keith/node/build/demo/win directory, then click Files Opions, check the compress compressed file, and finally click Process to finish.

These are all the contents of the article "how to use node-webkit". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report