{"id":13440941,"url":"https://github.com/romgrk/node-gtk","last_synced_at":"2025-10-07T09:50:06.580Z","repository":{"id":3072815,"uuid":"48313637","full_name":"romgrk/node-gtk","owner":"romgrk","description":"GTK+ bindings for NodeJS (via GObject introspection)","archived":false,"fork":false,"pushed_at":"2025-07-30T00:02:44.000Z","size":4158,"stargazers_count":529,"open_issues_count":81,"forks_count":41,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-10-04T20:30:13.169Z","etag":null,"topics":["gnome","gobject","gobject-introspection","gtk","gtk3","nodejs"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"WebReflection/node-gtk","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/romgrk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-12-20T09:06:15.000Z","updated_at":"2025-09-21T08:49:36.000Z","dependencies_parsed_at":"2023-12-22T20:58:01.443Z","dependency_job_id":"90f70dc1-20b1-4101-88d8-5b3ea9925283","html_url":"https://github.com/romgrk/node-gtk","commit_stats":{"total_commits":1094,"total_committers":27,"mean_commits":40.51851851851852,"dds":0.3171846435100548,"last_synced_commit":"8e34d290004add5808b28f43a2d1ded5482d512a"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/romgrk/node-gtk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romgrk%2Fnode-gtk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romgrk%2Fnode-gtk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romgrk%2Fnode-gtk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romgrk%2Fnode-gtk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/romgrk","download_url":"https://codeload.github.com/romgrk/node-gtk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romgrk%2Fnode-gtk/sbom","scorecard":{"id":783952,"data":{"date":"2025-08-11","repo":{"name":"github.com/romgrk/node-gtk","commit":"a770894677ec0f52bf7cc0830ed72b1544d71393"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Maintained","score":9,"reason":"5 commit(s) and 6 issue activity found in the last 90 days -- score normalized to 9","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":3,"reason":"Found 11/30 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yaml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/romgrk/node-gtk/main.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yaml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/romgrk/node-gtk/main.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yaml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/romgrk/node-gtk/main.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yaml:72: update your workflow using https://app.stepsecurity.io/secureworkflow/romgrk/node-gtk/main.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yaml:73: update your workflow using https://app.stepsecurity.io/secureworkflow/romgrk/node-gtk/main.yaml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/main.yaml:99","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: COPYING:0","Info: FSF or OSI recognized license: MIT License: COPYING:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 14 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"17 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-776f-qx25-q3cc","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T05:35:50.480Z","repository_id":3072815,"created_at":"2025-08-23T05:35:50.481Z","updated_at":"2025-08-23T05:35:50.481Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278755130,"owners_count":26040026,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gnome","gobject","gobject-introspection","gtk","gtk3","nodejs"],"created_at":"2024-07-31T03:01:28.134Z","updated_at":"2025-10-07T09:50:06.575Z","avatar_url":"https://github.com/romgrk.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca\u003e\n      \u003cimg\n        alt=\"NODE-GTK\"\n        width=\"250\"\n        src=\"https://raw.githubusercontent.com/romgrk/node-gtk/master/img/node-gtk-logo.svg?sanitize=true\"\n      /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003enode-gtk\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eGNOME Gtk+ bindings for NodeJS\u003c/b\u003e\n  \u003cbr/\u003e\n  \u003cimg src=\"https://img.shields.io/npm/v/node-gtk\" alt=\"Package Version\" /\u003e\n\u003c/p\u003e\n\nNode-Gtk is a [gobject-introspection](https://gi.readthedocs.io/en/latest) library for nodejs. It makes it possible to\nuse any introspected library, such as Gtk+, usable.  It is similar in essence to [GJS](https://wiki.gnome.org/action/show/Projects/Gjs) or [PyGObject](https://pygobject.readthedocs.io). Please note this project is currently in a _beta_ state and is being developed. Any contributors willing to help\nwill be welcomed.\n\nSupported Node.js versions: **20**, **22**, **24** (other versions may work but are untested)\u003cbr\u003e\nPre-built binaries available for: **Linux**, **macOS**\n\n### Table of contents\n\n- [Usage](#usage)\n- [Documentation](#documentation)\n- [Installing and building](#installing-and-building)\n  - [Target Platforms](#target-platforms)\n  - [Requirements](#requirements)\n  - [How to build on Ubuntu](#how-to-build-on-ubuntu)\n  - [How to build on Fedora](#how-to-build-on-fedora)\n  - [How to build on ArchLinux](#how-to-build-on-archlinux)\n  - [How to build on macOS](#how-to-build-on-macos)\n  - [How to build on Windows](#how-to-build-on-windows)\n  - [Testing the project](#testing-the-project)\n    - [Browser demo](#browser-demo)\n- [Contributing](#contributing)\n\n## Usage\n\nBelow is a minimal example of how to use the code, but take a look at\nour [template](https://github.com/romgrk/node-gtk-template) or at\n[react-gtk](https://github.com/codejamninja/react-gtk) to bootstrap your\nproject.\n\n```javascript\nconst gi = require('node-gtk')\nconst Gtk = gi.require('Gtk', '3.0')\n\ngi.startLoop()\nGtk.init()\n\nconst win = new Gtk.Window()\nwin.on('destroy', () =\u003e Gtk.mainQuit())\nwin.on('delete-event', () =\u003e false)\n\nwin.setDefaultSize(200, 80)\nwin.add(new Gtk.Label({ label: 'Hello Gtk+' }))\n\nwin.showAll()\nGtk.main()\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./img/hello-node-gtk.png\" alt=\"Hello Gtk\" style=\"width: 220px; height: auto;\"/\u003e\n\u003c/p\u003e\n\nSee our [examples](./examples) folder for more examples, and in particular the\n[browser demo source](https://github.com/romgrk/node-gtk/blob/master/examples/browser.js) for\na more complex application.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./img/browser.png\" alt=\"Hello Gtk\" style=\"max-width: 500px; height: auto;\"/\u003e\n\u003c/p\u003e\n\n\n## Documentation\n\n[Read our documentation here](./doc/index.md)\n\n## Installing and building\n\nNote that prebuilt binaries are available for common systems, in those cases building is not necessary.\n\n##### Target Platforms\n\n - **Linux**: prebuilt binaries available\n - **macOS**: prebuilt binaries available\n - **Windows**: no prebuilt binaries\n\n### Requirements\n\n - `git`\n - `nodejs@10` or higher\n - `python3` (for `node-gyp`)\n - C compiler (`gcc@8` or higher, or `clang`)\n\n### How to build on Ubuntu\n\nInstall basic dependencies.\n\n```sh\nsudo apt-get install \\\n  build-essential git \\\n  gobject-introspection \\\n  libgirepository1.0-dev \\\n  libcairo2 \\\n  libcairo2-dev\n```\n\nAt this point `npm install node-gtk` should already install, fallback and build `node-gtk` without problems.\n\n### How to build on Fedora\n\nInstall basic dependencies:\n\n```sh\nsudo dnf install \\\n  @development-tools \\\n  nodejs \\\n  nodejs-devel \\\n  gobject-introspection \\\n  gobject-introspection-devel \\\n  gtk3 \\\n  gtk3-devel \\\n  cairo \\\n  cairo-devel\n```\n\nAfter installing of packages, run `npm install node-gtk`.\n\n### How to build on ArchLinux\n\nThe following should be the bare minimum to be able to build the project.\n\n```sh\npacman -S --needed \\\n  base-devel git \\\n  nodejs npm \\\n  gtk3 gobject-introspection \\\n  cairo\n```\n\nFeel free to install all `base-devel` utilities.\n\nAfter installing those packages, `npm install node-gtk` would do.\n\n### How to build on macOS\n\nAssuming you have [brew](http://brew.sh) installed, the following has been successfully tested on El Captain.\n\n```sh\nbrew install git node gobject-introspection gtk+3 cairo\n```\n\nAt this point `npm install node-gtk` should already install, fallback and build `node-gtk` without problems.\n\n### How to build on Windows\n\nMandatory dependency is Visual C++ Build Environment: Visual Studio Build Tools (using \"Visual C++ build tools\" workload) or Visual Studio Community (using the \"Desktop development with C++\" workload).\n\nThe easiest/tested way to build this repository is within a _MinGW shell_ provided by the [MSYS2 installer](https://msys2.github.io/).\n\nOnce VS and its C++ compiler is available and MSYS2 installed, launch the MinGW shell.\n\n```sh\n# update the system\n# in case of errors, wait for the update to complete\n# then close and open again MingW shell\npacman -Syyu --noconfirm\n\n# install git, gtk3 and extra dependencie\npacman -S --needed --noconfirm git mingw-w64-$(uname -m)-{gtk3,gobject-introspection,pkg-config,cairo}\n\n# where to put the repository clone?\n# pick your flder or use ~/oss (Open Source Software)\nmkdir -p ~/oss/\ncd ~/oss\n\n# clone node-gtk there\ngit clone https://github.com/romgrk/node-gtk\ncd node-gtk\n\n# don't include /mingw64/include directly since it conflicts with\n# Windows SDK headers. we copy needed headers to __extra__ directory:\n./windows/mingw_include_extra.sh\n\n# if MSYS2 is NOT installed in C:/msys64 run:\nexport MINGW_WINDOWS_PATH=$(./windows/mingw_windows_path.sh)\n\n# first run might take a while\nGYP_MSVS_VERSION=2017 npm install\n```\n\nThe `GYP_MSVS_VERSION` could be 2017 or above.\nPlease verify [which version you should use](https://github.com/nodejs/node-gyp#installation)\n\nThe below blog post series will help you get started:\n\n1. [Node.js GTK Hello World on Windows](https://ten0s.github.io/blog/2022/07/22/nodejs-gtk-hello-world-on-windows)\n2. [Find DLLs and Typelibs dependencies for Node.js GTK Application on Windows](https://ten0s.github.io/blog/2022/07/25/find-dlls-and-typelibs-dependencies-for-nodejs-gtk-application-on-windows)\n3. [Package Node.js GTK Application on Windows](https://ten0s.github.io/blog/2022/07/27/package-nodejs-gtk-application-on-windows)\n\n#### Possible issue on MinGW shell\n\nIn case you are launching the general executable without knowing the correct platform,\nthe binary path might not be available.\n\nIn such case `python` won't be available either, and you can check via `which python` command.\n\nIf not found, you need to export the platform related binary path:\n\n```sh\n# example for the 32bit version\nexport PATH=\"/mingw32/bin:$PATH\"\nnpm run install\n```\n\nThis should do the trick. You can also check if there is any python at all via `pacman -Qs python`.\n\n### Testing the project\n\nIf you'd like to test everything builds and work properly, after installing and building you can run any of the\nexamples:\n\n```sh\nnode ./examples/hello-gtk.js\n```\n\nIf you'll see a little window saying hello that's it: it works!\n\nPlease note in macOS the window doesn't automatically open above other windows.\nTry \u003ckbd\u003eCmd\u003c/kbd\u003e + \u003ckbd\u003eTab\u003c/kbd\u003e if you don't see it.\n\n#### Browser demo\n\nIf you'd like to test `./examples/browser.js` you'll need [WebKit2 GTK+](http://webkitgtk.org/) libary.\n\n- in **Ubuntu**, you can `apt-get install libwebkit2gtk-3.0` (`4.0` works too) and try it out.\n- in **Fedora**, you should run `sudo dnf install webkit2gtk3`\n- in **ArchLinux**, you can `pacman -S --needed webkitgtk` and try it out.\n- in **macOS**, there is no way to run it right now because `webkitgtk` was removed from homebrew\n\nOnce installed, you can `./examples/browser.js google.com` or any other page, and you might try the _dark theme_ out too:\n\n```sh\n# macOS needs to have the Adwaita theme installed\n# brew install adwaita-icon-theme\n\n# Usage: ./examples/browser.js \u003curl\u003e [theme]\n./examples/browser.js  google.com  dark\n```\n\n## Contributing\n\nIf you'd like to help, we'd be more than happy to have support. To setup your development environment, you can\nrun `npm run configure`. You can then build the project with `npm run build`. To generate the `compile_commands.json`\nfor LSP to work nicely, you can use [bear](https://github.com/rizsotto/Bear) as `bear -- npm run build`.\n\n - https://developer.gnome.org/gi/stable/index.html\n - https://v8docs.nodesource.com/\n - https://github.com/nodejs/nan#api\n\nThere is a [Discord channel](https://discord.gg/r2VqPUV) but it receives little monitoring, use github issues or\ndiscussions preferably.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromgrk%2Fnode-gtk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromgrk%2Fnode-gtk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromgrk%2Fnode-gtk/lists"}