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 🙏

© 2024 – Pkg Stats / Ryan Hefner

uruburu

v0.0.19

Published

UI widgets for real time data

Downloads

20

Readme

uruburu

UI Widgets for real time data

Based on Web components concept and Polymer implementation, this microlibrary provides several components for automation applications. These are widgets that allow you to watch or update real time data.

Provided example is based on Mosca/MQTT in order to push data to the browser. When installing through Node, you get available a Node library that's implements the publish/subscriber part. Then, doing something like:

var uruburu = require('uruburu');

var server = new uruburu.Server({
	port: 31013,
	baseDir: '../'
});

is starting an Express Web Server and Mosca broker, pushing index.jade (from baseDir/views folder) to the browser when connecting to the corresponding location (in this case, <your_ip>:31013). This is 'animating' in some way the data display, since, starting from then, bindings are processed. this means that updating one variable on an object through an user action, updates commonly shared dictionary through MQTT and, then, any graphical object bound to that variable.

Bindings are obtained thanks to attribute specific syntax, which looks like value="{{inputVariable}}" when graphical object is updated by the variable state and like value="@{{outputVariable}}" when variable is updated by the object state.

Library can also be used as Javascript one, without Polymer. In that case, bindings need to be managed by your own.

Tests have been done using Chrome. Touch screens are not currently managed in a proprer way, but library works on Android KitKat devices as well.

Screen capture

Install

npm install uruburu

or clone this repository to your disk, go to the uruburu folder and do:

npm install

You need npm/nodejs to be installed.

Prerequisits

Because Mosca depends on ZMQ, you need to install first the dev version of ZMQ lib:

sudo apt-get install libzmq-dev

ZMQ is not used in our examples, currently.

Run examples

To run server part:

node server.js

To run client part (simple data generation):

node client.js

Usage

See /views/index.jade file.

Which dependencies ? Why ?

One of the worst issues with node, is precisely its bigger advantage: infinite number of available libraries. Everybody can understand that using third party dependencies is avoiding to reinvent the wheel. The piece of code that you write, needs to be as simple and small as possible. Sometimes, there is even no need to write anything: just integrate other's great work is enough. This is about engineering, and not programming.
Any way, it would be good if each project were explaining why it's using each one of its dependencies. At least in a few words. So:

  • Mosca: provides MQTT protocol within a node js broker, as well as through web sockets to the browser client.Indeed, our goal was initially not only to provide a simple graphic library for data acquisition and control, but also a simple mechanism to update all this stuff. Publisher/subscriber is the one that suits better and, then, MQTT seems to be one of the best choices.
  • mqtt.js: mqtt client side, mqtt implementation for Mosca server.
  • express.js and related middlewares (body-parser, serve-favicon): provide a way to create a web server with some sugar embedded and with only few lines of code. For embedded targets with small code foot print necessary, this could be replaced by stuff like node-static, for example.
  • jade: because I don't like HTML and I prefer Jade syntax. Of course, these can be removed very simply and quickly.
  • winston: for fun of logging. Can be removed in 5 minutes.
  • my-ip: get the IP of the machine in a more secured way. No need to hard code the IP and, then, more flexible.

That's only on node js side. Browser side, we use is d3js (simply the best data driven library) and Polymer (only for web components).

And that's all folks...