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 🙏

© 2026 – Pkg Stats / Ryan Hefner

nw_node

v1.2.7

Published

NodeWire for nodejs

Downloads

37

Readme

Introduction

NodeWire is a framework for building IoT devices and software that works with them. This library allows you to build nodejs applications that can seamlessly communicate with NodeWire based devices.

NodeWire supports a dataflow/message-driven programming paradigm. It extends the reactive paradigm to distributed applications that are interconnected - also known as microservices. Every NodeWire app must implement a node interface. A node is a virtual appliance that has input and output ports. The inside of a node is a state machine and a node interacts with other nodes only through its input and output ports.

To read more about NodeWire please visit http://www.nodewire.org

Creating a node

First create an app:

$ mkdir mynode
$ cd mynode
$ npm init

Next, install nodewire:

$ npm install nw_node

Create your source file, 'app.js' and paste the following code in it:

var nw = require('nw_node').nw;
var node = require('nw_node').node;

const conf = {                          // this will work but you should replace it with your own nodewire account credentials
    username:"[email protected]",    // register an account at dashboard.nodewire.org
    password:"aB01@",
    instance:"1jex2k7cbedg",
    server:"dashboard.nodewire.org",
}
nw.debug_level=0 // 0 = no debug messages, 1 = only important messages, 2 = all messages
nw.connect(conf);
nw.once('gack', async ()=>{
    let the_node = new node('test', {inputs: 'start reset', outputs: 'count'}); // create the node. the parameters aree the node name and the list of input and output ports

    the_node.count = 0; // initialize the port values, this is optional
    the_node.reset = 0;
    the_node.start = 0;
 
    the_node.when('reset', count=>the_node.count=count);  // respond to incoming port value

    setInterval(() => {            // the internal logic of our node: count if the start port is equal to 1
        if(the_node.start===1)
        {
            the_node.count += 1;
            console.log(the_node.count);
        }
    }, 1000);
});

Next run the code:

$ node app.js

Nothing significant will happen.

Now lets create another project, so we can control the node remotely:

Monitoring and Controlling the node

Open another command/shell window and type the following:

$ mkdir myapp
$ cd myapp
$ npm init

Next, install nodewire:

$ npm install nw_node

Create your source file, 'app.js' and paste the following code in it:

var nw = require('nw_node').nw;

const conf = {
    username:"[email protected]",
    password:"aB01@",
    instance:"1jex2k7cbedg",
    server:"dashboard.nodewire.org",
}
let thenode;
nw.debug_level=0 // 0 = no debug messages, 1 = only important messages, 2 = all messages
nw.connect(conf);
nw.once('gack', async ()=>{
    console.log('connected');
    thenode = await nw.getnode('test');  // get the node

    nw.when('test.count', (count)=>{  // monitor port changes
        console.log(count);
        if(count===10) thenode.reset = 20; // jump to count 20
        if(count==30){                // stop the count when count is 30
            thenode.start = 0;
            console.log('stop count');
        }
    });

    setTimeout(()=>{
        console.log('start count');
        thenode.start = 1;  // start count after 1 second
    }, 2000);
});

now, run application:

$ node app.js

You will the the two applications interacting with each other.

NodeWire Signals

NodeWire is based on an event driven paradigm. You always have to monitor signals in order to respond to them. And most of the code will be invalid if not executed after a certain event, most importantly after the 'gack' signal is received.

This signal signifies that the connection is fully established and all system parameters have been initialized.

Most signals are made of nodename followed by a period and then a portname: 'nodename.portname'. And it is activated whenever the corresponding portvalue changes.

There are two ways to monitor a signal, either by using the 'once' function which monitors the signal only once and then ignores subsequent occurrences. Or by using the 'when' function which continues to monitor the signal indefinitely. Both of these functions can be used simultaneously.

Controlling our node from the NodeWire dashboard

Using the NodeWire Database to store values

Using NodeWire with ExpressJs