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 🙏

© 2025 – Pkg Stats / Ryan Hefner

brig

v0.1.17

Published

Graphical render engine for Node.js

Downloads

37

Readme

Brig

A user interface toolkit for Node.js, which is based on Qt for rendering. This project can be used to load and play QML file, make it possible to have a easy way to communicate between QML and Node.js. That means developer is able to write desktop application in QML with pure JavaScript.

NPM

Requirements

Ensure Qt 5+ tookits and Node.js 0.10+ are ready to go on your system.

Installation

Install module via NPM

npm install brig

Get Started

There is a simple way to go by loading existed QML file, so you can prepare a QML content like below:

Application.qml

import QtQuick 2.3
import QtQuick.Controls 1.0

ApplicationWindow {
	visible: true;
	color: 'black';
	title: 'Brig Demo';
	width: 640;
	height: 480;

	Text {
		anchors.centerIn: parent;
		text: 'Brig';
		font.family: 'Helvetica';
		font.bold: true;
		font.pointSize: 72;
		color: '#00ffcc';
		scale: 0;
		opacity: 0;

		Text {
			anchors.topMargin: 10;
			anchors.top: parent.bottom;
			anchors.horizontalCenter: parent.horizontalCenter;
			text: 'QML Application in Node.js';
			font.family: 'Helvetica';
			font.pointSize: 16;
			color: '#e6fffa';
		}

		Behavior on opacity {
			NumberAnimation {
				duration: 800;
				easing.type: Easing.OutCubic;
			}
		}

		Behavior on scale {
			NumberAnimation {
				duration: 1000;
				easing.type: Easing.OutBack;
			}
		}

		Component.onCompleted: {
			opacity = 1.0;
			scale = 1.0;
		}
	}
}

Then using Brig to load file in Node.js:

var Brig = require('brig');

var brig = new Brig();

brig.on('ready', function(brig) {

  // Loading QML file to play
  brig.open('Application.qml', function(err, window) {
    // window was opened
  });
});

Customized Type

(This is experimental feature, API might be changed in the next version)

You can create a customized type in order to expose some APIs or functionality from Node.js to QML, see below:

var myQmlType = brig.createType('MyItem', {
	property: {
		prop1: 123
	},
	method: {
		'readFile(a)': function(filename) {
			return require('fs').readFileSync(filename).toString();
		}
	},
	signal: [
		'test(a)'
	]
});

// Triggered when instance of customized type was created
myQmlType.on('instance-created', function(instance) {

	// Signals
	instance.on('test', function(a) {
		// test(a) signal was emitted
		console.log(a);
	});
});

In QML, we can import customized type with its type name and use it directly:

import Brig.MyItem 1.0

Usage:

MyItem {
	// attributes...
}

Examples

Some exmaples you can found which used brig:

Demonstration

Here is a great countdown timer with Brig for hackathon event to show off, you can click image to play YouTube video:

Countdown Timer (clicks to play video)

License

Licensed under the MIT License

Authors

Copyright(c) 2015-2017 Fred Chien <[email protected]>