libui-node
Advanced tools
Comparing version 0.0.0 to 0.0.1
{ | ||
"name": "libui-node", | ||
"version": "0.0.0", | ||
"description": "", | ||
"version": "0.0.1", | ||
"description": "Node.js bindings for libui", | ||
"repository": "parro-it/libui-node", | ||
"license": "MIT", | ||
"author": "parro-it", | ||
"libui": "preres-alpha4", | ||
"contributors": [ | ||
{ | ||
"name": "Chan Guan Hao", | ||
"email": "guanhao3797@gmail.com", | ||
"url": "http://mavenave.me" | ||
}, | ||
{ | ||
"name": "Andrea Parodi", | ||
"email": "andrea@parro.it", | ||
"url": "http://www.parro.it" | ||
} | ||
], | ||
"scripts": { | ||
"test": "ava && xo" | ||
"test": "NO_AT_BRIDGE=1 ava && xo", | ||
"start": "NO_AT_BRIDGE=1 node examples/control-gallery.js", | ||
"start-np": "NO_AT_BRIDGE=1 node examples/node-pad.js", | ||
"start-core": "NO_AT_BRIDGE=1 node examples/core-api.js", | ||
"autogypi": "autogypi", | ||
"node-gyp": "node-gyp", | ||
"install": "libui-download ${npm_package_libui} && autogypi && npm run build", | ||
"build": "node-gyp configure build", | ||
"clean": "rm -rf build; rm *.h; rm *.dylib" | ||
}, | ||
"keywords": [], | ||
"keywords": [ | ||
"libui", | ||
"desktop", | ||
"desktop", | ||
"GUI" | ||
], | ||
"engines": { | ||
"node": ">=5" | ||
"node": ">=0.12" | ||
}, | ||
@@ -22,6 +47,8 @@ "files": [ | ||
}, | ||
"gypfile": true, | ||
"dependencies": { | ||
"nan": "^2.3.3" | ||
"autogypi": "^0.2.2", | ||
"libui-download": "0.0.3", | ||
"nbind": "^0.2.1", | ||
"node-gyp": "^3.3.1" | ||
} | ||
} |
141
readme.md
# libui-node | ||
> libui Node.js bindings. | ||
[![Travis Build Status](https://img.shields.io/travis/parro-it/libui-node.svg)](http://travis-ci.org/parro-it/libui-node) | ||
[![Travis Build Status](https://img.shields.io/travis/parro-it/libui-node/master.svg)](http://travis-ci.org/parro-it/libui-node) | ||
[![NPM module](https://img.shields.io/npm/v/libui-node.svg)](https://npmjs.org/package/libui-node) | ||
[![NPM downloads](https://img.shields.io/npm/dt/libui-node.svg)](https://npmjs.org/package/libui-node) | ||
[libui](https://github.com/andlabs/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. | ||
<p align="center"> | ||
<h2>Linux</h2> | ||
<img src ="https://cloud.githubusercontent.com/assets/11197111/15990529/68e924f4-3095-11e6-8a13-b91678def555.png"> | ||
</p> | ||
<center> | ||
## OSX | ||
![OSX](https://cloud.githubusercontent.com/assets/11197111/16003613/bf03b908-315d-11e6-9c67-850ace39ffc1.png) | ||
</center> | ||
# 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. | ||
However, 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. | ||
# Project status | ||
* All current `libui` API, except for [these ones](https://github.com/parro-it/libui-node/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement) 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 very few tests developed, but they are passing in `Travis` thank you to @jjrv awesome work. | ||
* This is not yet battle-tested in a real app, but the control gallery example you saw in the screenshot above is fully working. | ||
# Build Requirements | ||
* All platforms: | ||
- CMake 2.8.11 or newer | ||
* Windows: either | ||
-Microsoft Visual Studio 2013 or newer (2013 is needed for va_copy()) | ||
-MinGW-w64 (other flavors of MinGW may not work) | ||
* Unix: nothing else specific | ||
* Mac OS X: nothing else specific, so long as you can build Cocoa programs | ||
# Installation | ||
We don't publish new versions to NPM yet. | ||
When we will, we are planning to download `libui` binaries directly from its github repo. See some details [here](https://github.com/andlabs/libui/issues/124). | ||
Meanwhile, you have to build `libui` on your machine. This require the use of CMake 2.8.11 or newer. | ||
## Install cmake on OSX: | ||
```bash | ||
npm install --save libui-node | ||
brew install cmake | ||
``` | ||
# Usage | ||
## Install cmake on Debian base Linux distro: | ||
```js | ||
const libuiNode = require('libui-node'); | ||
```bash | ||
apt-get install cmake | ||
``` | ||
You also need to pull the `libui` git submodule to grab it's sources. | ||
```bash | ||
git clone https://github.com/parro-it/libui-node.git | ||
git submodule init | ||
git submodule update | ||
npm install | ||
``` | ||
To run the control gallery example, type: | ||
```bash | ||
npm start | ||
``` | ||
__Note__: There is some problem with then control gallery example on OSX. | ||
We are investigating it, if you are affected, you can meanwhile try the core-api example: | ||
```bash | ||
npm run start-core | ||
``` | ||
# Usage | ||
Plase look in [examples folder](https://github.com/parro-it/libui-node/tree/master/examples). | ||
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](https://github.com/parro-it/libui-node/blob/master/examples/utils.js). | ||
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. | ||
## Publishing | ||
Since `libui` binaries are relatively small, we plan to precompile them for supported platforms and publish binaries file directly to NPM, to avoid the native build stage on install. | ||
# 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](https://github.com/charto/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](https://github.com/parro-it/libui-node/blob/master/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 | ||
* build:libui - rebuild libui sources under `libui` git submodule | ||
## Related projects | ||
* [libui](https://github.com/andlabs/libui) - Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports. | ||
* [nbind](https://github.com/charto/nbind) - Magical headers that make your C++ library accessible from JavaScript | ||
# Contributors | ||
[![Andrea Parodi](https://avatars0.githubusercontent.com/u/11197111?s=130)](https://github.com/parro-it) | [![Juha Järvi](https://avatars3.githubusercontent.com/u/778781?s=130)](https://github.com/jjrv) | [![Chan Guan Hao](https://avatars1.githubusercontent.com/u/5748750?s=130)](https://github.com/mavenave) | ||
---|---|--- | ||
[Andrea Parodi](https://github.com/parro-it) | [Juha Järvi](https://github.com/jjrv) | [Chan Guan Hao](https://github.com/mavenave) | ||
# License | ||
@@ -22,0 +151,0 @@ |
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
9706
4
59
155
0
4
1
+ Addedautogypi@^0.2.2
+ Addedlibui-download@0.0.3
+ Addednbind@^0.2.1
+ Addednode-gyp@^3.3.1
+ Addedabbrev@1.1.1(transitive)
+ Addedajv@6.12.6(transitive)
+ Addedansi-regex@2.1.1(transitive)
+ Addedaproba@1.2.0(transitive)
+ Addedare-we-there-yet@1.1.7(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedautogypi@0.2.2(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedblock-stream@0.0.9(transitive)
+ Addedbluebird@3.7.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedcode-point-at@1.1.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcommander@2.9.0(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedconsole-control-strings@1.1.0(transitive)
+ Addedcore-util-is@1.0.21.0.3(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addeddeep-extend@0.6.0(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addeddelegates@1.0.0(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedemscripten-library-decorator@0.1.8(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedfstream@1.0.12(transitive)
+ Addedgauge@2.7.4(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedglob@6.0.47.2.3(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedgraceful-readlink@1.0.1(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhas-unicode@2.0.1(transitive)
+ Addedhome-path@1.0.7(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedini@1.3.8(transitive)
+ Addedis-fullwidth-code-point@1.0.0(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedlibui-download@0.0.3(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addedms@2.0.0(transitive)
+ Addedmv@2.1.1(transitive)
+ Addednbind@0.2.1(transitive)
+ Addedncp@2.0.0(transitive)
+ Addednode-gyp@3.8.0(transitive)
+ Addednopt@3.0.6(transitive)
+ Addednpmlog@4.1.2(transitive)
+ Addednumber-is-nan@1.0.1(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedos-homedir@1.0.2(transitive)
+ Addedos-tmpdir@1.0.2(transitive)
+ Addedosenv@0.1.5(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedpify@2.3.0(transitive)
+ Addedpinkie@2.0.4(transitive)
+ Addedpinkie-promise@2.0.1(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedpsl@1.15.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedrc@1.2.8(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedregenerator-runtime@0.9.6(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedresolve@1.1.7(transitive)
+ Addedrimraf@2.4.5(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsemver@5.3.0(transitive)
+ Addedset-blocking@2.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedstring-width@1.0.2(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedstrip-ansi@3.0.1(transitive)
+ Addedstrip-json-comments@2.0.1(transitive)
+ Addedtar@2.2.2(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedverror@1.10.0(transitive)
+ Addedwhich@1.3.1(transitive)
+ Addedwide-align@1.1.5(transitive)
+ Addedwrappy@1.0.2(transitive)
- Removednan@^2.3.3