Sign In

@squawk/navaids

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package version was removed
This package version has been unpublished, mostly likely due to security reasons
This package has malicious versions linked to the ongoing "Mini Shai-Hulud" supply chain attack.

Affected versions:

0.4.20.4.30.4.4
+2 more
View campaign page

@squawk/navaids

Navaid queries by identifier, frequency, type, location, or name search

unpublished
Source
npmnpm
Version
0.4.2
Version published
Weekly downloads
62
-8.82%
Maintainers
1
Weekly downloads
 
Created
Source

squawk logo  @squawk/navaids

MIT License npm TypeScript

Pure logic library for querying US navaid data. Look up navaids by identifier, frequency, geographic proximity, type, or name search. Contains no bundled data - accepts an array of Navaid records at initialization. For zero-config use, pair with @squawk/navaid-data.

Part of the @squawk aviation library suite. See all packages on npm.

Usage

import { usBundledNavaids } from '@squawk/navaid-data';
import { createNavaidResolver } from '@squawk/navaids';

const resolver = createNavaidResolver({ data: usBundledNavaids.records });

// Look up by identifier
const bos = resolver.byIdent('BOS');

// Find by frequency (MHz for VOR-family, kHz for NDB-family)
const onFreq = resolver.byFrequency({ frequency: 113.7 });

// Find nearest navaids to a position
const nearby = resolver.nearest({ lat: 42.3656, lon: -71.0096 });
for (const result of nearby) {
  console.log(result.navaid.name, result.distanceNm, 'nm');
}

// Get all navaids of a type
const vors = resolver.byType(new Set(['VOR', 'VORTAC', 'VOR/DME']));

// Search by name or identifier
const results = resolver.search({ text: 'boston' });

Consumers who have their own navaid data can use this package standalone:

import { createNavaidResolver } from '@squawk/navaids';

const resolver = createNavaidResolver({ data: myNavaids });

Browser / SPA usage

The resolver factory has no Node-specific imports and ships an explicit /browser subpath for SPAs and edge runtimes. Pair it with @squawk/navaid-data/browser:

import { loadUsBundledNavaids } from '@squawk/navaid-data/browser';
import { createNavaidResolver } from '@squawk/navaids/browser';

const dataset = await loadUsBundledNavaids();
const resolver = createNavaidResolver({ data: dataset.records });

The /browser entry is identical to the main entry; the separate subpath exists so browser support is an explicit, publint-verified part of the public API surface.

API

createNavaidResolver(options)

Creates a resolver object from an array of Navaid records.

Parameters:

  • options.data - an array of Navaid objects (from @squawk/types)

Returns: NavaidResolver - an object with the lookup methods described below.

resolver.byIdent(ident)

Looks up navaids by identifier (e.g. "BOS", "JFK"). Multiple navaids can share the same identifier (e.g. an NDB and a VOR at different locations). Case-insensitive. Returns Navaid[].

resolver.byFrequency(query)

Finds navaids operating on a given frequency. For VOR-family navaids the frequency is in MHz; for NDB-family navaids it is in kHz.

PropertyTypeDescription
frequencynumberFrequency value to match (MHz for VOR-family, kHz for NDB-family)
typesReadonlySet<NavaidType>Optional. When provided, only navaids of these types are returned
limitnumberOptional. Maximum number of results. Defaults to 20

Returns Navaid[], sorted alphabetically by identifier.

resolver.nearest(query)

Finds navaids nearest to a geographic position, sorted by distance ascending.

PropertyTypeDescription
latnumberLatitude in decimal degrees (WGS84)
lonnumberLongitude in decimal degrees (WGS84)
maxDistanceNmnumberOptional. Maximum distance in nautical miles. Defaults to 30
limitnumberOptional. Maximum number of results. Defaults to 10
typesReadonlySet<NavaidType>Optional. When provided, only navaids of these types are returned

Returns NearestNavaidResult[], each containing:

  • navaid - the matched Navaid record
  • distanceNm - great-circle distance in nautical miles (rounded to 2 decimal places)
// Find the 5 nearest VORTACs within 50 nm
const nearby = resolver.nearest({
  lat: 42.3656,
  lon: -71.0096,
  maxDistanceNm: 50,
  limit: 5,
  types: new Set(['VORTAC']),
});

resolver.byType(types)

Returns all navaids matching the given type(s), sorted alphabetically by identifier.

const ndbs = resolver.byType(new Set(['NDB', 'NDB/DME']));

resolver.search(query)

Searches navaids by name or identifier using case-insensitive substring matching. Results are returned in alphabetical order by name.

PropertyTypeDescription
textstringCase-insensitive substring to match against name or identifier
limitnumberOptional. Maximum number of results. Defaults to 20
typesReadonlySet<NavaidType>Optional. When provided, only navaids of these types are returned

Returns Navaid[].

Keywords

aviation

FAQs

Package last updated on 11 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts