It uses requestAnimationFrame and it generates sound, so it will be easy to demonstrate that with NW.js the requestAnimationFrame timer will keep going even if the app's window is hidden behind others. The app for this tutorial is a simple metronome. In the end however NW.js is not that hard to use. My app however relies on requestAnimationFrame for timing, and I couldn't use Electron because of an issue in Chromium (the timer stops when the app window is hidden). NW.js instead or ElectronĮlectron is the better known of the frameworks for creating native applications. I've written this tutorial using MacOS 10.14 (Mojave), Ubuntu 18.04 and Windows 10. I hope it can help you to get started using NW.js and to create desktop programs and installers. This tutorial is an overview of my findings. I'm a frontend developer with little experience in creating desktop applications and installers, so it took me some time find all the details of how to set everything up. It works by combining a JavaScript app with Node.js and Google's Chromium browser engine into a single desktop program. NW.js is a framework for building desktop applications with HTML, CSS, and JavaScript. (Update december 2020: This guide still works with NW.js v50.1 on Mac OS v10.15 (Catalina), Ubuntu v20.04.1 LTS and Windows 10 Pro v1709) package.This is an overview and tutorial of how to create desktop programs for Linux, Mac and Windows using NW.js. It describes what node-webkit should load and various parameters of the window. It all starts with the package.json file, which node-webkit looks up when starting. To run it, CD into this folder, and try running the app with this command: /path/to/node-webkit/nw. However, it won't work if you simply double click index.html - it requires Node.js modules, which is invalid in a web browser. From here this looks like a standard static website. Once you extract it, you will see the files above. It fetches the most recent articles on Tutorialzine from our RSS feed and turns them into a cool looking 3D carousel using jQuery Flipster. Click it and get a zip with a sample app that we prepared for you. There is a Download button near the top of this article. You can optionally add the extracted node-webkit folder to your PATH, so that it is available as the nw command from your terminal. This will open a new node-webkit window and print a bunch of debug messages in your terminal. # (the paths are only for illustrative purposes, any folder will do) path/to/node-webkit/nw /your/project/folderĬ:\path\to\node-webkit\nw.exe C:\your\project\folder To start it, you need to do this in your terminal: # If you are on linux/osx Extract the archive somewhere on your computer. Head over to the project page and download the executable that is built for your operating system. (Later you can package everything in a single program so your users can only click an icon to start it). Installing Node-WebKitįor developing applications, you will need to download the node-webkit executable, and call it from your terminal when you want to run your code. In the future we might update it if there are any changes. For now, this tutorial is perfectly compatible with it. Sounds interesting? Keep reading! Update (15th Jan 2015) - Just after a week of publishing this tutorial, node-webkit was renamed to NW.js. The JavaScript code that you write is executed in a special environment and has access to both standard browser APIs and Node.js. Node-WebKit is a combination of Node.js and an embedded WebKit browser. In this short tutorial, we will show you how to create a simple desktop application using Node-WebKit, which combines jQuery and a few Node.js modules. Thanks to Node-WebKit, we can even create desktop applications that feel native, and have full access to every part of the operating system. These days you can do pretty much anything with JavaScript and HTML.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |