{"id":20514119,"url":"https://github.com/webreflection/jsgtk","last_synced_at":"2025-04-14T00:05:00.066Z","repository":{"id":57284388,"uuid":"46875709","full_name":"WebReflection/jsgtk","owner":"WebReflection","description":"A simplified approach to GJS for Node.JS and JavaScript developers.","archived":false,"fork":false,"pushed_at":"2017-11-08T16:09:27.000Z","size":18239,"stargazers_count":85,"open_issues_count":0,"forks_count":9,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-14T00:04:56.599Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://webreflection.github.io/jsgtk/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WebReflection.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-25T17:10:26.000Z","updated_at":"2021-06-15T01:31:04.000Z","dependencies_parsed_at":"2022-09-16T22:41:46.166Z","dependency_job_id":null,"html_url":"https://github.com/WebReflection/jsgtk","commit_stats":null,"previous_names":[],"tags_count":61,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fjsgtk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fjsgtk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fjsgtk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fjsgtk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebReflection","download_url":"https://codeload.github.com/WebReflection/jsgtk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248799954,"owners_count":21163404,"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","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":[],"created_at":"2024-11-15T21:14:52.004Z","updated_at":"2025-04-14T00:05:00.029Z","avatar_url":"https://github.com/WebReflection.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSGtk+ [ DEPRECATED ]\n\nThis project is death. **Long live [cgjs](https://github.com/cgjs/cgjs)**.\n\n- - -\n\nThis project has not received enough support to be sustainable Open Source Software and it was too big to be maintained by a single developer.\n\nThe new alternative, based on modern js52+ SpiderMonkey engine, dropped 90% of the useless crap I've implemented in here.\n\nLesson learned, move on and switch to [CGJS](https://github.com/WebReflection/cgjs) today.\n\n- - -\n\n\n### Project Ideas\nFollowing the current list of project ideas and achievements:\n\n  * a _CommonJS_-like module loader, compatible with any [npm](https://www.npmjs.com/) module\n  * a _Node.JS_ like environment with `process`, `console`, `require` and most common _Node.JS_ [core modules](https://github.com/WebReflection/jsgtk/tree/master/jsgtk_modules)\n  * an automatically transformed ECMAScript 2015 syntax for _GJS SpiderMonkey_ environment via [babel-standalone](https://github.com/WebReflection/babel-standalone) and [loaded modules](https://github.com/WebReflection/jsgtk/blob/master/examples/es6.js)\n  * a `camelCase` imported namespace to make _GJS_ modules look more _JavaScripty_\n  * a cross platform, lightweight, yet powerful namespace that brings **_Gtk_ native Widgets** to every compatible OS\n  * a _Node.JS_ and \"_Web.JS_\" friendly way to attach/detach signals ( `obj.on(signal, listener)` )\n\n\n\n### Platforms\nCurrently developed and tested on **Linux** ([ArchLinux](https://www.archlinux.org/), [Debian](http://www.debian.org/), [Fedora](https://getfedora.org/), [Ubuntu](http://www.ubuntu.com/)) and **Darwin** ([OSX](http://www.apple.com/uk/osx/)) platforms.\n\n\n\n### How To Install\n\nOn **ArchLinux** you can simply use `yaourt -S --needed jsgtk` installing from [AUR](https://aur.archlinux.org/packages/jsgtk/).\n\nOn other common **Linux** distros, and also on **OSX**, you can use the following terminal command and follow its instructions:\n```sh\n# optionally you can export WEBKIT=true upfront\nsh -c \"$(curl -fsSL https://webreflection.github.io/jsgtk/install)\"\n```\n\n\u003csup\u003eIf you would like to know what that script does, feel free to read the used [install file content](https://github.com/WebReflection/jsgtk/blob/gh-pages/install).\u003c/sup\u003e\n\n\nThere is also a `jsgtk` package on **npm** and it is possible to install it via `npm install -g jsgtk`.\nHowever, in this case, please be sure you have installed dependencies first.\nSome hint about best way to install them might be printed on the terminal once installed.\n\n\n\n### Dependencies\nThis project trusts and uses 100% _GJS_, which is usually available through one of the following procedures:\n\n  * on **ArchLinux**: `pacman -S --needed gjs` and optionally `webkit2gtk` for the `browser.js` example\n  * on **Debian** and **Ubuntu**: `apt-get install gjs` and optionally `libwebkit2gtk-4.0` or higher for the `browser.js` example\n  * on **Fedora**: pretty much everything is already installed (both `gjs` and `webkitgtk4` are available)\n  * on **OSX Homebrew**: `brew install gtk+3 gjs` and optionally `webkitgtk` for the `browser.js` example (although right now there is some problem)\n  * on **OSX MacPorts**: `port install gjs adwaita-icon-theme xorg-server xinit` and optionally `webkit2-gtk` for the `browser.js` example. Please note `xorg-server` requires to log out and back in again before it can work.\n\nPlease remember [using the installer](https://github.com/WebReflection/jsgtk#how-to-install) brings in all dependencies so most likely there's nothing else to do.\n\n\n\n### Gtk/UI Examples\nTo test if everything is fine, you can create a `test.js` file and run it via `jsgtk test.js` or, after `chmod +x test.js`, directly via `./test.js`:\n```js\n#!/usr/bin/env jsgtk\nconst Gtk = require('Gtk');\nGtk.init(null);\nconst win = new Gtk.Window({\n  title: 'jsgtk',\n  type: Gtk.WindowType.TOPLEVEL,\n  windowPosition: Gtk.WindowPosition.CENTER\n})\n  .once('show', () =\u003e {\n    win.setKeepAbove(true);\n    Gtk.main();\n  })\n  .on('destroy', Gtk.mainQuit)\n;\nwin.add(new Gtk.Label({label: 'Hello jsGtk+'}));\nwin.setDefaultSize(200, 80);\nwin.showAll();\n```\n\nThere is also a [jsgtk-examples](https://github.com/WebReflection/jsgtk-examples#jsgtk-examples) repository which includes most common `GJS` examples, readapted for `jsgtk`.\n\n\n\n#### Tests and other examples\nIf you clone this repository, `npm test` is the way to test few functionalities.\nOnce cloned locally, you can also try `./jsgtk examples/base.js` or [any other file](https://github.com/WebReflection/jsgtk/tree/master/examples).\n\nIf you'd like to debug an application, pass a `-d` or a `--debug` argument to the app.\n\nOptionally, you can set `GDK_DEBUG=all` to have all possible info about the app.\n\n\n### Why not [node-gir](https://github.com/creationix/node-gir) or [node-gtk](https://github.com/WebReflection/node-gtk)?\nWell, apparently both projects are stuck/abandoned and unfortunately there's no other option ^_^;;","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebreflection%2Fjsgtk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebreflection%2Fjsgtk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebreflection%2Fjsgtk/lists"}