@squawk
    Preparing search index...

    Function createAircraftFeedForSource

    • Creates a live aircraft feed for a source chosen at runtime, dispatching to createJsonAircraftFeed, createSbsAircraftFeed, or createBeastAircraftFeed. Meant for callers that take the source from a CLI flag or config value and want one call site instead of a switch. Node-only, since the SBS and Beast sources are - not exported from this package's /browser entry.

      port defaults to the selected source's entry in DEFAULT_PORT_BY_SOURCE. For the json source the endpoint is url when given, otherwise dump1090-fa's standard http://<host>:<port>/data/aircraft.json. Options that do not apply to the selected source are ignored.

      import { createAircraftFeedForSource } from '@squawk/adsb-feed';

      const feed = createAircraftFeedForSource({ source: 'beast', host: '192.168.1.50' });
      feed.addEventListener('aircraft:update', (event) => {
      console.log((event as CustomEvent).detail.aircraft);
      });
      feed.start();

      Parameters

      • options: SourceFeedOptions

        The source to connect to, station host/port, per-source extras, and tracker configuration.

      Returns AircraftFeed

      An AircraftFeed ready to start().