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

@atmosx/event-product-parser

v2.0.16

Published

NOAA Weather Wire & NWS API Parser - Built for standalone and Project AtmosphericX Integration.

Readme

Installation (NPM)

npm install @atmosx/event-product-parser@latest

Example Usage

const { AlertManager } = require('@atmosx/product-parser'); // CJS
import { AlertManager } from '@atmosx/product-parser'; // ESM

const parser = new AlertManager({
    database: `shapefiles.db`,
    is_wire: true,
    journal: true,
    noaa_weather_wire_service_settings: {
        reconnection_settings: {
            enabled: true,
            interval: 60,
        },
        credentials: {
            username: `username_here`,
            password: `password_here`,
            nickname: "AtmosphericX Parser",
        },   
        cache: {
            enabled: false,
            max_db_history: 5000,
            max_db_cache_size: 1000,
        },
        preferences: {
            disable_ugc: false,
            disable_vtec: false,
            disable_text: false,
            cap_only: false,
        }
    },
    national_weather_service_settings: {
        interval: 15,
        endpoint: `https://api.weather.gov/alerts/active`,
    },
    global_settings: {
        parent_events_only: true,
        better_event_parsing: true,
        shapefile_coordinates: false,
        shapefile_skip: 10,
        filtering: {
            events: [`Severe Thunderstorm Warning`],
            filtered_icao: [`KLOT`],
            ignored_icao: [],
            ignored_events: [`Xx`, `Test Message`],
            ugc_filter: [],
            state_filter: [],
            check_expired: true,
            ignore_test_products: true,
        },
        eas_settings: {
            directory: null,
            intro_wav: null,
        }
    },
})

NOAA Weather Wire Service (Getting Started)

To use the NOAA Weather Wire Service (NWWS). You would need to obtain credentials from the National Weather Service. Follow these steps:

  1. Visit the NOAA NWWS Registration Page.
  2. Fill out the registration form with the required information.
  3. Submit the form and wait for approval. You will receive your NWWS credentials via email.

Events and Listeners

All events are in GeoJSON.

Event onEvents

Triggered when a batch of new alerts are received and processed.

parser.on(`onEvents`, (alerts) => {
    console.log(`Received ${alerts.length} new alerts.`);
    alerts.forEach(alert => {
        console.log(`${alert.properties.event} for ${alert.properties.locations}`);
    });
});

Alternatively, you can listen for single alert events using onSevereThunderstormWarning or onTornadoWarning, etc.

parser.on(`onTornadoWarning`, (alert) => {
    console.log(`Tornado Warning issued for ${alert.properties.locations}`);
});

Event onReconnection

Triggered when the parser attempts to reconnect to the NWWS service.

parser.on(`onReconnection`, (data) => {
    console.log(`Reconnection attempt #${data.reconnects}`);
});

Event onConnection

Triggered when the parser successfully connects to the NWWS service.

parser.on(`onConnection`, (nickname) => {
    console.log(`Connected to NWWS service as ${nickname}`);
});

Event onOccupant

Triggered when a new occupant is detected on the NWWS XMPP service.

parser.on(`onOccupant`, (data) => {
    console.log(`New occupant detected: ${data.occupant}`);
});

Event onMessage

Triggered when a stanza message is validated and received from the XMPP client.

parser.on(`onMessage`, (data) => {
    console.log(`Message received from ${data.from}: ${data.message}`);
});

Event onTest

Triggered when a test message comes in. Ex: Test Tsunami Warning

parser.on(`onTest`, (alert) => {
    console.log(`Test alert received for ${alert.properties.locations}`);
});

Event onExpired

Triggered when an alert expires.

parser.on(`onExpired`, (alert) => {
    console.log(`Alert expired for ${alert.properties.event} for locations of ${alert.properties.locations}`);
});

Event onFilteredEvent / onIgnoredEvent

Triggered when an alert is filtered out.

parser.on(`onFilteredEvent`, (alert) => {
    console.log(`Alert filtered for ${alert.properties.event}`);
});
parser.on(`onIgnoredEvent`, (alert) => {
    console.log(`Alert ignored for ${alert.properties.event}`);
});

Event onFilteredICAO / (onIgnoredICAO)

Triggered when an alert is filtered out based on its ICAO code.

parser.on(`onFilteredICAO`, (alert) => {
    console.log(`Alert filtered for ${alert.properties.event}`);
});
parser.on(`onIgnoredICAO`, (alert) => {
    console.log(`Alert ignored for ${alert.properties.event}`);
});

Event onFilteredUGC

Triggered when an alert is filtered out based on its UGC zone.

parser.on(`onFilteredUGC`, (alert) => {
    console.log(`Alert filtered for ${alert.properties.event}`);
});

Event onFilteredState

Triggered when an alert is filtered out based on its state (Abbreviation)

parser.on(`onFilteredState`, (alert) => {
    console.log(`Alert filtered for ${alert.properties.event}`);
});

Event log

Triggered for logging purposes, providing log level and message.

parser.on(`log`, (message) => {
    console.log(data.message);
});

Callbacks and Functions

Function setDisplayName(name)

Sets the display name for the XMPP client. This requires reconnection to take effect.

parser.setDisplayName(`My Weather Parser`);

Function createEasAudio(description, header)

Generates an EAS audio file based on the provided description and header. Audio file will be located based on settings provided in the global_settings.eas_settings object. If you are running linux, festival is required to use this or it will error out.

parser.createEasAudio(`This is a test alert`, `EAS Header Info`);

Function getAllAlertTypes()

Returns an array of all supported alert types by the parser.

const alertTypes = parser.getAllAlertTypes();
console.log(alertTypes);

Function getEventPolygon(event)

Retrieves the geographical polygon for a given event based on its generated geocode and UGC zones. (Returns in GeoJSON format)

const polygon = await parser.getEventPolygon(event);
console.log(polygon);

Function searchStanzaDatabase(query)

Searches the internal stanza database for messages matching the provided query.

const results = parser.searchStanzaDatabase(`Tornado Warning`);
console.log(results);

Function setSettings({})

Dynamically updates the parser settings. Accepts the same configuration object as the constructor.

parser.setSettings({
    global_settings: {
        filtering: {
            ignored_icao: [`KXYZ`],
        }
    }
});

Function stop()

Stops the parser and disconnects from the NWWS service.

parser.stop();

References

NOAA NWWS Information | NWS API Documentation | XMPP Protocol | AtmosphericX |
Documentation | Discord Server | Project Board |
Code of Conduct | Contributing | License | Security | Changelogs |

Acknowledgements

  • k3yomi
    • Lead developer @ AtmosphericX and maintainer of this module.
  • StarflightWx
    • For testing and providing feedback (Co-Developer and Spotter @ AtmosphericX)