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

tessel-reactive

v0.1.0

Published

Reactive programming library For Tessel.IO

Downloads

6

Readme

Introduction

Tessel reactive is a functional reactive programming library that uses BaconJS in order to expose streams for Tessel modules, buttons, pins, …

It allows you to quickly develop for a Tessel.io board in a functional/baconJS style.

Modules

The library contains classes to work in a reactive style using the following modules and perhiperals. Note that it DOES NOT depend on the required libraries for the supported tessel modules. You have to instantiate those yourself.

Modules provide either input, output or both. The inputs and outputs are BaconJS streams/buses respectively, and provide/consume objects. Each object has a value. For example, a digital pin will produce events with a value true/false depending on the pin state (high/low).

A LED (which is a digital pin set to output) can consume the same values in order to SET the pin state (see example).

Supported out of the box:

  • Digital pin (input/output)
    • Button (input)
    • LED (input/output)
    • Motion/PIR (input)
  • Climate (input/output)
    • Inputs
      • Temperature
      • Humidity
      • Heater state
    • Outputs
      • Heater state
      • Temperature calibration
      • Humidity calibration
  • Ambient (input)
    • Light level
    • Sound level
  • Relay (input/output)
    • Relay 1 state (input/output)
    • Relay 2 state (input/output)

Example

var tessel = require("tessel"), tr = require("tessel-reactive");
var climate = require("climate-si7020");
var ambient = require("ambient-attx4");

var climateModule = new tr.ClimateModule(climate.use(tessel.port.B),{name:"climateB", interval: 1000});

var ambientModule = new tr.AmbientModule(ambient.use(tessel.port.C),{name:"ambientA",interval: 1000});

var button = new tr.Button(new tr.DigitalPin(tessel.button),{name:"Button 2"});
var blueLED = new tr.DigitalPin(tessel.led[1]);

var aggregatedInputs = climateModule.input().merge(ambientModule.input());

aggregatedInputs.onValue(function(value)){
	console.log(value);
};

// subscribe the blue led pin to the output of the button.
// The led will respond to the boolean button states...
blueLED.output().plug(button.input());