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

signalk-collision-alerts

v0.5.0

Published

Collision alerts for Signal K: CPA/TCPA warnings for nearby traffic, raised through the Notifications API

Downloads

1,213

Readme

Signal K Collision Alerts

Warns you when another vessel is on course to pass too close. For every AIS target in range (and every radar or camera target, on servers that merge them) the plugin works out the closest point of approach (CPA) and the time until it (TCPA), and raises a Signal K alarm when both fall inside your chosen limits. Chart plotters such as Freeboard-SK show the alarm, sound it, and let you acknowledge or silence it.

Setup

Install the plugin from the App Store. A new installation starts on its own with the Coastal sensitivity; an installation you disabled earlier stays off until you enable it in its settings. To change the sensitivity, pick an Alert sensitivity there:

| Sensitivity | Warn | Alarm | | ----------------- | -------------------------- | -------------------------- | | Harbour | CPA ≤ 100 m within 5 min | CPA ≤ 50 m within 2 min | | Coastal (default) | CPA ≤ 0.5 NM within 12 min | CPA ≤ 0.25 NM within 6 min | | Offshore | CPA ≤ 1 NM within 20 min | CPA ≤ 0.5 NM within 10 min | | Custom | your own list of zones | |

If you used the CPA calculation in SK Derived Data, turn it off there so you don't get every alarm twice.

What it publishes

  • notifications.navigation.closestApproach.<target id> on own vessel, one alarm per target, through the server's Notifications API so acknowledge and silence work from any app. The alarm's data carries targetRef (the target's Signal K context, e.g. vessels.urn:mrn:imo:mmsi:244123456), source, cpa (m), tcpa (s), range (m), the target's targetCog (rad, null when it is stopped) and targetSog (m/s), and cpaPositions.
  • vessels.<target id>.navigation.closestApproach {distance, timeTo} for each target in range (can be turned off).

While you and another boat are both slower than 3 kn (Use Harbour limits when both boats are slower than), that boat is judged by the Harbour limits, so the boats at anchor you motor past on arrival don't alarm. A faster boat keeps your chosen limits. Set it to 0 to turn this off.

A boat slower than 0.5 kn counts as stopped: boats at anchor report a speed and course that are mostly noise, so two of them never alarm on each other. Anything actually moving towards you still does.

A boat that will pass behind you, more than about 105° off your bow at its closest point, raises nothing unless it will come inside the alarm distance, because a boat crossing your wake is not on a collision course. One that will come that close warns and alarms as usual.

A boat that reports being stopped but keeps moving the same way, more than 40 m over a few minutes, is judged by its measured course and speed, so a neighbour dragging its anchor toward you raises the alarm. Your own boat is treated the same way. Position noise and a boat swinging back and forth at anchor don't count.

By default, at most three targets alarm at once (Alarm for at most this many targets at once, 1 to 5): the highest level first, then the soonest closest approach. The rest alarm as soon as they become one of the most urgent, so a crowded anchorage doesn't bury you in alarms.

An alarm escalates as soon as a target enters a stricter zone, and is held until the target is clearly outside it again, so a CPA hovering on a limit doesn't make the alarm flicker.

Radar and other sensors

The plugin also evaluates radar and camera targets that sensor plugins publish as targets.<type>:<id> contexts (mayara does this for ARPA targets), so boats without AIS are covered too. When a fusion plugin such as Target Fusion links a target to the AIS vessel it is (sameAs), the two are one boat and raise one alarm, not two. Install Target Fusion alongside this plugin if you have radar or a camera (the App Store lists it as recommended); without it a boat seen on both AIS and radar alarms twice. The boat then moves with whichever sensor reported last, so radar keeps tracking it after its AIS falls silent. The alarm points at the AIS vessel when there is one, and otherwise at the target's context (targets.radar:…); data.sources lists every sensor that sees it.

Sensor plugins may also raise alarms of their own. While this plugin runs it sets globalThis.__signalk_collisionAlerts = { evaluatesTargets: true }, and the mayara plugin leaves radar alarms to it then (from the release with mayara-server-signalk-plugin#144), so a ship seen on radar does not alarm twice. With an older mayara plugin, set its radar collision alarm setting to Leave to the Collision Alerts plugin instead.

Development

npm install
npm run build:all   # lint + format check, build, tests