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 🙏

© 2025 – Pkg Stats / Ryan Hefner

flexradio-js

v1.2.5

Published

FlexRadio Control and Monitoring Nodes

Readme

flexradio-js FlexRadio 6xxx JavaScript Library

This is a simple JavaScript library that takes advantage of the FlexRadio 6xxx series' network interface. There are no other applications, programs, or libraries needed. This library communicates directly with the radio and offers a JavaScript interface.

The library offers...

  • Radio discovery; listening for and emitting data about radios that are advertising themselves on the local network using the Discovery class.

  • Command and control of the radio; able to send commands to control the radio and receive responses about success and failure as well as emit informational status messages (TCP-based data).

  • Collection of meter and other realtime data sent by the radio to clients (UDP-based data). NOTE: meter data is emitted, panadapter and other data is still a work in progress (May 2021).

Using the Library

Setup

The primary way to interact with the library is via the Radio class. Once setup the Radio will emit asynchronous events for incoming data.

const { Radio } = require('flexradio-js/Radio');

const radio = new Radio({ip:'192.168.10.100', port:4992});
radio.on('connected', function() {
    console.log('connected to radio');
});

radio.on('status', function(status) {
    // capture asynchronous status messages
    console.log('received status: ' + JSON.stringify(status));
});

radio.on('meter', function(meter) {
    // capture asynchronous/realtime meter data, need to `sub meter` to get these
    console.log('received meters: ' + JSON.stringify(meter));
});

radio.on('error', function(error) {
    console.log(error);
});

radio.connect();

Emitted Events

Connection events:

  • connecting - trying to connect to radio
  • connected - connected to radio
  • disconnected - disconnected from radio
  • listening - listening for asynchronous data from radio
  • error - an error in communicating. Must be caught or will crash!

Data events:

  • message - an inter-radio message
  • handle - client handle (sent as part of client connection process)
  • version - the radio interface version (sent as part of client connection process).
  • status - asynchronous status update (usually result of a sub command)
  • meter - asynchronous meter update (usually result of a sub command)

Sending Commands

The Radio class can also be used to send commands to the radio.

To change the transmit power to 25:

radio.send('transmit rfpower 25', function(response) {
    console.log('recevied response: ' + JSON.stringify(response));

To ask the radio to send meter data, which will trigger the meter events:

radio.send('sub meter 18', function(response) {
    // this response is just an acknoledgement the meter was subscribed to
    // actual meter data will be emitted with the topic `meter` and can be
    // captured as in the example above.
    console.log('recevied response: ' + JSON.stringify(response));

Decoding FlexRadio Data

There is also a decoder for data sent by the radio included as part of this library that can be accessed independently of the Radio and Discovery classes. The decoder decodes the textual portion of the TCP data the radio sends back to clients. This includes version, handle, message, status, and response messages.

Normally you will not be needing this as the Radio class already decodes these data for you. But, just in case, there it is.

const flex = require('flexradio');
const message = flex.decode(encoded_message);