Using Node and Electron to build Desktop Apps: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
<gallery>
<gallery>
Nodejs-new-pantone-black.png|Node JS
Nodejs-new-pantone-black.png|Node JS
Npm.png|Node Package Manager JS
Npm.png|Node Package Manager
Electronjs.png|Electron JS
Electronjs.png|Electron JS
</gallery>
</gallery>
Line 7: Line 7:
AppStudio now supports the use of a some of the biggest new technologies in the web development world.
AppStudio now supports the use of a some of the biggest new technologies in the web development world.


[https://nodejs.org/en/ Node.js] is a runtime environment that executes JavaScript code outside the browser. That makes it suitable for writing server side software, which would normally be done in PHP or other languages.
[https://nodejs.org/en/ Node.js] is a runtime environment that executes JavaScript code outside the browser. That makes it suitable for writing server side software, which would normally be done in PHP or other languages. It works by having an executable stub which is able to call the V8 JavaScript engine, which powers Chrome.
 
[https://www.npmjs.com/ npm] is a repository of code which can be used with Node.js. It's included when you download Node. There is a huge number of packages available - over 750,000 at last count. You can include these packages in your Node project to add functionality. It might be for convenience: there are a lot of libraries which are much easier to include in your project than to write yourself. It might be for functionality: the modules can implement features which would not be available in the browser.
 
An example of a convenient library would be [https://lodash.com/ Lodash] which adds hundreds of additional functions to JavaScript. A missing feature library would be [https://github.com/jprichardson/node-fs-extra fs-extra] which allows full access to the file system.
 
[https://electronjs.org/ Electron] is framework which allows for the development of desktop GUI applications. Since it's built on Node.js, it already has the ability to run JavaScript code. It also uses Chrome's browser engine to render the UI using regular HTML. Each Electron app includes the V8 Runtime as well as the Chrome browser. Slack, Github Desktop and Whatsapp are examples of apps built using Electron.

Revision as of 23:05, 19 February 2019

AppStudio now supports the use of a some of the biggest new technologies in the web development world.

Node.js is a runtime environment that executes JavaScript code outside the browser. That makes it suitable for writing server side software, which would normally be done in PHP or other languages. It works by having an executable stub which is able to call the V8 JavaScript engine, which powers Chrome.

npm is a repository of code which can be used with Node.js. It's included when you download Node. There is a huge number of packages available - over 750,000 at last count. You can include these packages in your Node project to add functionality. It might be for convenience: there are a lot of libraries which are much easier to include in your project than to write yourself. It might be for functionality: the modules can implement features which would not be available in the browser.

An example of a convenient library would be Lodash which adds hundreds of additional functions to JavaScript. A missing feature library would be fs-extra which allows full access to the file system.

Electron is framework which allows for the development of desktop GUI applications. Since it's built on Node.js, it already has the ability to run JavaScript code. It also uses Chrome's browser engine to render the UI using regular HTML. Each Electron app includes the V8 Runtime as well as the Chrome browser. Slack, Github Desktop and Whatsapp are examples of apps built using Electron.