Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

libui-node

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libui-node

Node.js bindings for libui

  • 0.0.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
20
decreased by-31.03%
Maintainers
2
Weekly downloads
 
Created
Source

libui-node

libui Node.js bindings.

Travis Build Status NPM module NPM downloads

libui is a simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports.

It is in early stage of development, but is evolving at great pace and is really awesome.

It could become an awesome, lightweight alternative to Electron to develop multiplatform GUI.

Linux

## OSX ![OSX](https://cloud.githubusercontent.com/assets/11197111/16003613/bf03b908-315d-11e6-9c67-850ace39ffc1.png)

Supported platform

  • Windows: Windows Vista SP2 with Platform Update or newer
  • Unix: GTK+ 3.10 or newer
  • Mac OS X: OS X 10.8 or newer

Node version requirement

The project run on any node version > 0.12.

Project status

  • All current libui API, except for these ones are implemented.
  • I'm developing on linux, so this is the preferred platform to test. OSX should work too, but it's not tested. Windows has yet to be configured in build scripts, but it will be supported in further releases.
  • There are some tests developed, and they are passing in Travis thank you to @jjrv awesome work, both on OSX and on Linux, in Node > 0.12
  • This is not yet battle-tested in a real app, but the control gallery example you saw in the screenshot above is fully working.

Installation

We had published a first pre-release to npm. You can now install libui-node as a simple dependency in your project:

npm install -S libui-node

libui prebuilt binaries are automatically downloaded after install.

# Examples

Some example in examples folder uses ES6 syntax. We will soon configure babel transpilation for them. Meanwhile, if you are testing the project on Node.js < 6, you can check examples/core-api.js that use Es5 syntax.

First, you have to clonse the GitHub repo and npm install it:

git clone https://github.com/parro-it/libui-node.git
npm install

Then, to run the control gallery example, type:

npm start

And for the core api, example, type:

npm run start-core

Usage

Plase look in examples folder. We will write complete API documentation soon...

Future directions of the project

API

This binding is actually implementing low-level API straight to the libui ones. We plan to add another level of API on top of it to simplify GUI building. You can get a taste of how they will be in example utils.js file.

This new API will support transpilation from JSX to further simplify GUI building.

These works will become in future the base for a React-Native like project.

Contribution & design

  • Each libui widget implementaion is written in it's own C++ file in src folder.
  • Each widget is implemented in it's own C++ class, each class is a simple wrapper for related libui C functions.
  • There is an header file called src/ui-node.h that contains all classes definitions.
  • Widget events does not follow node convention: if you attach an handler to an event, previous one will be overwritten and never be called. This will be resolved on future high-level API repo, where each widget will be an EventEmitter instance.
  • We build the project using the awesome nbind tool, that automate the process of linking a straight C++ class to Node.js stuff...
  • All the GUI code run in the node javascript main thread. You must call libui.startLoop to start the GUI event loop. It run one step at a time, you can see in index.js how this is implemented.

Useful NPM scripts

  • test - run AVA tests && XO linting.
  • start - start the control gallery example
  • build - rebuild C++ sources
  • libui - Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports.
  • nbind - Magical headers that make your C++ library accessible from JavaScript

Contributors

Andrea ParodiJuha JärviChan Guan Hao
Andrea ParodiJuha JärviChan Guan Hao

License

The MIT License (MIT)

Copyright (c) 2016 parro-it

Keywords

FAQs

Package last updated on 23 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc