NodeGUI

A library for building cross-platform native desktop applications with Node...

README

NodeGui

All Contributors JS Party #96 Build and Test status Discuss on GitHub

Build performant, native and cross-platform desktop applications with Node.js and CSS like styling.🚀

NodeGUI is powered by Qt5 💚 which makes it CPU and memory efficient as compared to other chromium based solutions like Electron.

If you are looking for **React** based version, check out: **[React NodeGUI](https://github.com/nodegui/react-nodegui)**.

If you are looking for **Vue** based version, check out: **[Vue NodeGUI](https://github.com/nodegui/vue-nodegui)**.

If you are looking for **Svelte** based version, check out: **[Svelte NodeGUI](https://github.com/nodegui/svelte-nodegui)**

Visit https://nodegui.github.io/nodegui for docs.

logo

How does it look?


demo_linuxdemo_windemo_mac
kitchendemo_macdemo_win

Code Examples


https://github.com/nodegui/examples


Features


-   🧬 Cross platform. Works on major Linux flavours, Windows, and MacOS.
-   📉 Low CPU and memory footprint. Current CPU stays at 0% on idle and memory usage is under 20MB for a Hello World program.
-   💅 Styling with CSS (includes actual cascading). Also has full support for Flexbox layout (thanks to Yoga).
-   ✅ Complete Nodejs API support (Currently runs on Node v16.x - and is easily upgradable). Hence has access to all Nodejs compatible NPM modules.
-   🎪 Native widget event listener support. Supports all events available from Qt / NodeJs.
-   💸 Can be used for Commercial applications.
-   🕵️‍♂️ Good Devtools support.
-   📚 Good documentation and website.
-   🧙‍♂️ Good documentation for contributors.
-   🦹🏻‍♀️ Good support for dark mode (Thanks to Qt).
-   🏅First class Typescript support. (Works on regular JS projects too 😉).

Getting Started


-   Check out nodegui-starter to get up and running with your own React NodeGUI app!
-   Read through the docs.
-   Checkout the examples: https://github.com/nodegui/examples .


Installation


To install latest stable release:

  1. ```
  2. npm install @nodegui/nodegui
  3. ```

To install the latest version available on master branch:

  1. ```
  2. npm install https://github.com/nodegui/nodegui/releases/download/v0.0.0-latest-master/nodegui-master.tgz
  3. ```

or a shorter version:

  1. ```
  2. npm i http://master-release.nodegui.org
  3. ```

If the installation fails to download the Qt binaries, a mirror can be used by setting the following environment variable and running the install command again:

  1. ```sh
  2. QT_LINK_MIRROR=<alternative domain> # eg. QT_LINK_MIRROR=https://qt-mirror.dannhauer.de

  3. npm install @nodegui/nodegui
  4. ```

See FAQs for more details.



Community guides


-   https://blog.logrocket.com/electron-alternatives-exploring-nodegui-and-react-nodegui/ - Electron alternatives: Exploring NodeGUI and React NodeGUI by Siegfried Grimbeek.
-   https://hibbard.eu/node-gui/ - Excellent guide from James Hibbard.

Talks/Podcasts



-

JS Party 96: Performant Node desktop apps with NodeGUI – Listen on Changelog.com


Docs for contributing


  1. ```
  2. It is easier than you think, try it
  3. ```

Looking to contribute? If you wish to implement a new widget/add more features and need help understanding the codebase, you can start here: Contributing developer docs.

Please read https://github.com/nodegui/.github/blob/master/CONTRIBUTING.md


Building from source


This section is useful for those wanting to work on NodeGui itself.

Required tooling


NodeGui requires CMake and Compilation Tools as it is a wrapper for a native C++ widget toolkit QT.
Detailed instructions here: https://www.sitepoint.com/build-native-desktop-gif-searcher-app-using-nodegui/

TL;DR:

MacOS

  1. ```
  2. brew install cmake
  3. brew install make
  4. ```


Windows

https://cmake.org/download/

Linux (Debian/Ubuntu)

  1. ```
  2. sudo apt-get install pkg-config build-essential
  3. sudo apt-get install cmake make
  4. sudo apt-get install mesa-common-dev libglu1-mesa-dev
  5. ```

Linux (Fedora/RHEL/CentOS)

  1. ```
  2. sudo dnf groupinstall "Development Tools" "Development Libraries"
  3. sudo dnf groupinstall "C Development Tools and Libraries"
  4. sudo dnf install mesa-libGL mesa-libGL-devel
  5. ```

Building


Once you have cloned this git repository, run this to build:

  1. ```
  2. npm install
  3. npm run build
  4. ```

The last step will takes some time to run as it builds the C++ binaries at the core of NodeGui.


Using your own custom Qt installation (Optional)


Compiling Qt from source

You will need to download and install Qt from source since there are no binaries from Qt for M1 yet.

(https://www.reddit.com/r/QtFramework/comments/ll58wg/how_to_build_qt_creator_for_macos_arm64_a_guide/)

  1. ```
  2. git clone git://code.qt.io/qt/qt5.git
  3. cd qt5
  4. git checkout 5.15

  5. ./init-repository --module-subset=essential -f
  6. git submodule init qtsvg
  7. git submodule update qtsvg

  8. cd ..
  9. mkdir qt5-5.15-macOS-release
  10. cd qt5-5.15-macOS-release

  11. ../qt5/configure -release QMAKE_APPLE_DEVICE_ARCHS=arm64 -opensource -confirm-license -nomake examples -nomake tests -skip qt3d -skip webengine -skip qtactiveqt -skip qtcanvas3d  -skip qtdeclarative -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtcharts -skip qtgraphicaleffects -skip qtlocation  -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtremoteobjects -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtvirtualkeyboard -skip qtscript

  12. make -j15

  13. make install
  14. ```

This should install Qt into something like this /usr/local/Qt-5.15.3 (your directory can change. This will be displayed when running make)

Pointing nodegui to use your custom Qt installation

Now just set `export QT_INSTALL_DIR=` . In the above example it would look something like this `export QT_INSTALL_DIR=/usr/local/Qt-5.15.3`. Add this in your .zshrc or .bashrc so that you dont need to repeat this process again.

Now just rm -rf node_modules and do npm install again.

The logs should say something like `CustomQt detected at . Hence, skipping Mini Qt installation`.


Running example programs


A number of small programs to show different parts of the Qt API are in src/examples. They can be run directly with:

  1. ```
  2. npm run qode dist/examples/modelview_1_readonly.js
  3. ```

Updating docs


npm run docs

then followed by:

`cd website && GIT_USER= yarn deploy`

Funding


NodeGui is an open source project and requires your support. If you like this project, please consider supporting my work by clicking on the Sponsor button on this Github repository or via Ko-Fi.
Alternatively, Issues on NodeGui can be funded by anyone via Issuehunt and the amount will be distributed to respective contributors.

Buy Me a Coffee at ko-fi.com    issuehunt


Special Thanks



Code of Conduct


https://github.com/nodegui/.github/blob/master/CODE_OF_CONDUCT.md

License


MIT

Backers 🚀


Thanks goes to these wonderful people.


Yuriy Yazlovytskyy
Yuriy Yazlovytskyy
John Susek
John Susek
Marc Dijoux
Marc Dijoux
Stephen Belanger
Stephen Belanger
Rustam
Rustam

Maintainers ✨


People maintaining this project.


Atul R
Atul R
Simon Edwards
Simon Edwards

Contributors ✨


Thanks goes to these wonderful people (emoji key):





Lucas Ramage

📖

Denis Sikuler

📖

Nahuel José

💬

Kakul Gupta

💻

Rahul Gaba

💻

Paweł Borecki

💻

Marcus S. Abildskov

⚠️

Átila Camurça Alves

📖

James Hibbard

💻

Soonwoo Hong

💻

Roy Sommer

💻

Paulo Coghi

🤔

Balthild Ires

💻

Dimitar Nestorov

💻

Mikko Sairio

💻

Pepijn

💻

slidinghotdog

💻

Bundyo (Kamen Bundev)

💻

feng8848

💻

Maksim Karelov

💻

mspencer92

💻

blncd2020

📖

gluaxspeed

💻

Solant

💻

Shubham Zanwar

💻

Singha360

💻

Mihkel

💻

Stephen A

💻

流君酱

💻

Adam Gastineau

💻

swittk

💻

craftingmod

💻

Doug Barbieri

💻

HENRIQUE DE SOUZA NERY

💻

Ruslan Garifullin

💻

Ranieri

💻 📖

Nathanael Anderson

💻

Ross

💻 📖

4h7l

💻

Maks

💻

zhb124404

📖

Wyatt Kirby

💻

Steven Koch

💻

Simon Edwards

💻






This project follows the all-contributors specification. Contributions of any kind welcome!