npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gtk3-node

v1.3.0

Published

Native Node.js extension for creating GTK3 widgets

Readme

GTK3 Extension for Node.js

This native extension enables creating graphical user interfaces using GTK3 from Node.js applications. It provides an abstraction layer over GTK3 that facilitates the creation of windows, buttons, and other widgets, as well as event management.

Requirements

  • Node.js 12 or higher
  • GTK3 with development libraries installed
  • node-gyp for compilation
  • Linux operating system (currently supported)

Installation

Before installing this extension, make sure you have the GTK3 development libraries installed:

# On Ubuntu/Debian systems
sudo apt install libgtk-3-dev

# On Fedora/RHEL systems
sudo dnf install gtk3-devel

# On Arch Linux systems
sudo pacman -S gtk3

Then, install the extension:

npm install ./path/to/gtk3-node-extension

Basic Usage

Creating a window with a button

const { Button, Window, init } = require('gtk3-node');

// Initialize GTK
init();

// Create a window
const window = new Window('My Application', 400, 300);

// Create a button
const button = new Button('Click here');

// Add an event handler to the button
button.onClick(() => {
  console.log('Button pressed!');
  button.label = 'Thanks for clicking!';
});

// Add the button to the window
window.add(button);

// Show the window and all its contents
window.show();

// Start the GTK event loop
Window.run();

API

Available Classes

Window

Represents a GTK3 window.

Constructor
  • new Window(title, width, height) - Creates a new window with the specified title and dimensions.
Methods
  • add(widget) - Adds a widget to the window.
  • show() - Shows the window and all its contents.
Static Methods
  • Window.run() - Starts the GTK event loop.
  • Window.quit() - Exits the GTK event loop.

Button

Represents a GTK3 button.

Constructor
  • new Button(label) - Creates a new button with the specified label.
Properties
  • label - The button's label (getter/setter).
Methods
  • onClick(callback) - Registers a function to be executed when the button is clicked.

Label

Represents a GTK3 label for displaying static text.

Constructor
  • new Label(text) - Creates a new label with the specified text.
Properties
  • text - The text displayed by the label (getter/setter).

Box

Represents a GTK3 container for organizing widgets in linear layouts.

Constructor
  • new Box(orientation) - Creates a new container with the specified orientation ('horizontal' or 'vertical').
Methods
  • add(widget) - Adds a widget to the container.

Scroll

Represents a GTK3 container with scrollbars for managing content that exceeds the visible area.

Constructor
  • new Scroll() - Creates a new scrollable container.
Methods
  • add(widget) - Adds a widget to the scrollable container.

Compilation

If you want to compile the extension yourself:

cd gtk3-node-extension
npm install
node-gyp configure
node-gyp build

Features

  • Creation of GTK3 widgets from JavaScript
  • Event system with callbacks
  • Native integration with GTK event loop
  • DRY principle applied in architecture

License

MIT