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 https://github.com/k3yomi/AtmosphericX project.
Documentation written by @k3yomi
npm install @atmosx/pulse-point-wrapperconst { PulsePoint } = require(`@atmosx/pulse-point-wrapper`); // CJS
import { PulsePoint } from `@atmosx/pulse-point-wrapper`; // 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.
}
})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.
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);
});This event listener is triggered when an incident is closed. When received, you should dispose of the incident data to maintain an accurate live view of active events.
pulse.on(`onIncidentClosed`, (incidentID) => {
console.log(incidentID);
});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}`);
});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);
});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()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
}
});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();PulsePoint |
Documentation |
Discord Server |
Project Board |
Code of Conduct |
Contributing |
License |
Security |
Changelogs |
- 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)