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

js-aprs-is

v2.0.1

Published

NodeJs library for connecting to an APRS-IS server.

Downloads

47

Readme

js-aprs-is npm Build Status Coverage Status Codacy Badge Known Vulnerabilities

APRS is a registered trademark Bob Bruninga, WB4APR.

This project will attempt to provide a node version of the perl-aprs-fap/HAM::APRS::FAP IS class/module. Over time, it is likely this will diverge from the original code due to platforms, but will attempt to keep usage straightforward and similar where applicable. The biggest difference will be the usage of a push rather than pull paradigm, which will also negate the need for some methods/functions.

  • This project is only intended to communicate with JavAPRS-IS and APRS-C servers, not TNCs.
  • This project only provides ability to connect to an APRS-IS server. Parsing functionality can be provided by [https://github.com/KD0NKS/js-aprs-fap]https://github.com/KD0NKS/js-aprs-fap or another library.

USAGE

Demo

https://github.com/KD0NKS/aprs-is-demo

npm

npm install js-aprs-is --save

Extends NodeJS Socket, which means this is not guranteed to deliver one APRS packet per tcp packet. Buffering must be implemented when using.

TypeScript

  • import import ISSocket from 'js-aprs-is';

Using this the easy way

let connection = new ISSocket("aprsserverurl", PORTNUMBER, "N0CALL", -1, FILTER);

connection.on('packet', (data: string) => {
    // ...
});

BYOB (Bring your own buffer)

let bufferedData = '';
let connection = new ISSocket("aprsserverurl", PORTNUMBER, "N0CALL", -1, FILTER);

// Probably not the best way, but good enough for now.  Still consumes world feed on low end computer.
connection.on('data', (data: Buffer) => {
    bufferedData += data.toString();
    let msgs = bufferedData.split('\r\n');

    if(this._bufferedData.endsWith('\r\n')) {
        this._bufferedData = '';
        msgs = msgs.filter(msg => msg.trim() != '');    // This is trimming out any empty messages
    } else {
        this._bufferedData = msgs.pop();
    }

    //...
}

KNOWN ISSUES

  • Timeout should be implemented.
    • Need to research timeout tollerance on APRS-IS servers. 30 seconds?
    • On timeout event, socket should automatically send login message.
    • Hook tests fail due to async issues.

TO CONSIDER

  • Allow connections to IS server to automatically reconnect on failure?
    • The original client specified number of retries at a half second interval.
    • Internal packet buffering to emit single packets?

SEE ALSO

ORIGINAL COPYRIGHT

  • Copyright (C) 2005-2012 Tapio Sokura
  • Copyright (C) 2007-2012 Heikki Hannikainen

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

UPGRADING 1.x.x to 2.x.x

ISSocket Constructor

The constructor paramaters have changed drastically. Please note the order has changed as well as what is required. - Callsign is no longer defaulted to discourage useage of erroneous callsigns. - appId is now required.

  • ISSocket.sendLine() is now deprecated.
    • Use sendLogin() and send() instead.
    • send() will still send server commands even if transmit is disabled.