JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q93579F
  • License MIT

AtmosphericX PulsePoint Polling - Built for standalone and Project AtmosphericX Integration.

Package Exports

  • atmosx-pulse-point
  • atmosx-pulse-point/dist/cjs/index.cjs
  • atmosx-pulse-point/dist/esm/index.mjs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (atmosx-pulse-point) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

AtmosphericX - PulsePoint Polling

PulsePoint is a public emergency response system used by fire departments, EMS agencies, and dispatch centers to share live incident information with the public. This module provides a way to poll and decrypt the data provided by PulsePoint. Please keep in mind that this module is unofficial and not endorsed by PulsePoint or its parent organization.

This module is primarily intended for use with the AtmosphericX project. This README provides basic information about the module.

Installation Guide

npm install atmosx-pulse-point

Example Usage

const { PulsePoint } = require(`atmosx-pulse-point`); // CJS
import { PulsePoint } from `atmosx-pulse-point`; // ESM

const pulse = new PulsePoint({
    key: `YOUR_PASSWORD_KEY_FOR_DECRYPTION`, // Not provided by PulsePoint, you must obtain this key yourself.
    interval: 30, // Polling interval in seconds (default: 60)
    jorunal: true, // Enable journaling for debug messages (default: true)
    filtering: {
        events: ["Mutual Aid", "Structure Fire"], // Leave empty to allow all event types
        agencies: ["FIRE5678", "EMS1234"], // This must be populated, leaving empty will NOT return any data.
    }
})

Decryption Key

By default, PulsePoint encrypts its data using client-side encryption. To decrypt the data, you need to provide a decryption key when initializing the module. This key is not provided by PulsePoint, and you must obtain it yourself. This module is really only to be used by those who already have access to the decryption key so they can integrate PulsePoint data into their own applications. Please ensure you comply with all relevant laws and regulations regarding the use of this data as I do not take any responsibility for how you use this module or the data it retrieves.

Events and Listeners

Event Update

This event listener is triggered whenever there is an update or new event in the incident data. The callback function receives an array of the incident objects and can be used to process or display the data as needed.

pulse.on(`onIncidentUpdate`, (incident) => {
    console.log(incident);
});

Event Log

The log listener captures log messages generated during the module's operation. This can be useful for debugging or monitoring the module's activity. This is mostly used when journaling is disabled. Otherwise, log messages will be displayed in the console directly.

pulse.on(`log`, (message) => {
    console.log(`[Log]: ${message}`);
});

Callbacks and Functions

Function getAvailableAgencies()

This asynchronous function retrieves a list of available agencies from the PulsePoint data source. It returns an array of agency identifiers that can be used for filtering or other purposes.

pulse.getAvailableAgencies().then((agencies) => {
    console.log(agencies);
});

Function getAvailableEvents()

This function retrieves a list of available event types from the PulsePoint data source. It returns an array of event type strings that can be used for filtering or other purposes.

pulse.getAvailableEvents()

Function setSettings({})

This function allows you to update the module's settings dynamically. You can change parameters such as the polling interval, journaling preference, and filtering options.

pulse.setSettings({
    interval: 45, // Update polling interval to 45 seconds
    journaling: false, // Disable journaling
    filtering: {
        events: ["Medical Emergency"], // Update event filtering
        agencies: ["FIRE1234"], // Update agency filtering
    }
});

Function stop()

This function stops the polling process. It can be used when you want to temporarily halt data retrieval without destroying the module instance.

pulse.stop();

References

Acknowledgements

  • CJ Ziegler
    • For inspiring me to create this module for storm spotting and night crawling streams.
    • Storm Spotter @ AtmosphericX
  • k3yomi
    • Lead developer @ AtmosphericX and maintainer of this module.
  • StarflightWx
    • For testing and providing feedback (Co-Developer and Spotter @ AtmosphericX)