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

webofthings

v0.1.0

Published

A Node.js Web of Things server and gateway for Linux based devices such as the Raspberry Pi, Beaglebone, Edison or Samsung Artik

Downloads

4

Readme

Node.js Web of Things Server

A server and gateway reference implementation of the W3C Web Thing Model, written in Node.js and tailored for embedded systems.

What is the Web Thing Model?

It's a simple model for Things to interact together and with app via the Web. Read more about it in a blogpost or even more in a webinar!

What is webofthings.js?

A simple, lightweight, and extensible implementation of the W3C Web of Things Model. in Node.js. It not (yet) a bomb proof gateway but a way to experiment with the Web of Things and the basis of the Building the Web of Things book where you'll learn how the framework works, how to deploy it on a Raspberry Pi and how to use it to serve Web access to sensors and actuators.

What does this do?

First, it implements a Web of Things server that you can run on any platform that supports Node and in particular on many embedded devices. Second, it exposes the services and function of your service over HTTP and WebSockets.

What devices does it support?

Any Windows or *Nix device really but if you want to use the GPIOs you will need an embedded device. The framework was tested on the Raspberry Pi (A, B, B+, Zero and 2) and the Beaglebone Black. Most of the code also works on the Intel Edison.

How is it built?

application architecture

How do I start it?

NPM

Install it: npm install webofthings

Run it: node wot.js or sudo node wot.js if you plan to use the temperature and humidity plugins.

How do I configure it?

The WoT gateway can be tweaked by changing the configuration parameters in /resources/piNoLd.json. The following parameters are available:

  "customFields": {
    "hostname":"localhost",
    "port": 8484,
    "secure": true, // true means the gateway will require HTTPS and an API key
    "dataArraySize" : 30 // size of the Properties and Actions arrays.
  },

If you use it in a serious environment make sure you:

  1. Generate/buy your own TLS certificates to replace the public certificate and private key in /resources.
  2. Make sure you generate a new API token to replace the default one (cKXRTaRylYWQiF3MICaKndG4WJMcVLFz) in /resources/auth.json, you can use the utils.generateApiToken() function to generate a new one.

How do I extend it?

The WoT Gateway framework comes with three internal plugins to connect it to sensors and actuators:

  • dht22Plugin.js to connect a temperature and humidity sensor
  • ledsPlugin.js to connect it to LEDs
  • pirPlugin.js to connect it to a passive infrared sensor

but it can easily be extended by adding internal or external plugins (i.e., to serve the resources of other devices via a Web API) extending corePlugin.js.

How do I run the tests?

  1. Install mocha npm install -g mocha
  2. Run the tests mocha

How do I learn more about the Web of Things?

Browse http://webofthings.org and/or buy the Building the Web of Things Book

building the web of things