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

gnss-js

v1.0.0

Published

Comprehensive GNSS library for JavaScript — time scales, coordinates, RINEX parsing, RTCM3 decoding, orbit computation, and signal analysis

Readme

gnss-js

Comprehensive GNSS library for JavaScript and TypeScript. Zero dependencies. Works in Node.js, browsers, Deno, Bun, and Workers.

Install

npm install gnss-js

Modules

Import only what you need via subpath exports:

Time scales

import {
  getGpsTime,
  getTimeOfWeek,
  getWeekNumber,
  getDateFromGpsData,
} from 'gnss-js/time';
import { getGalTime, getBdsTime, getUnixTime } from 'gnss-js/time';
import { getJulianDate, getMJD } from 'gnss-js/time';
import { getLeap, getGpsLeap, getUtcDate } from 'gnss-js/time';

const date = new Date('2024-01-15T12:00:00Z');
const gpsTime = getGpsTime(date); // milliseconds since GPS epoch
const tow = getTimeOfWeek(date); // milliseconds into current GPS week
const week = getWeekNumber(date); // GPS week number

Coordinates

import {
  geodeticToEcef,
  ecefToGeodetic,
  vincenty,
  deg2rad,
} from 'gnss-js/coordinates';

const [x, y, z] = geodeticToEcef(deg2rad(48.8566), deg2rad(2.3522), 35);
const { distance } = vincenty(
  deg2rad(51.5),
  deg2rad(-0.1),
  deg2rad(48.9),
  deg2rad(2.4)
);
// distance in meters, angles in radians

RINEX parsing

import { parseRinexStream, parseNavFile } from 'gnss-js/rinex';

// Streaming observation parser (works with ReadableStream)
const result = await parseRinexStream(stream, {
  onObservation: (time, prn, codes, values) => {
    // process each epoch
  },
});

// Navigation file parser
const nav = parseNavFile(navFileText);
// nav.ephemerides: KeplerEphemeris[] | GlonassEphemeris[]

RTCM3 decoding

import { Rtcm3Decoder, decodeMsmFull, decodeEphemeris } from 'gnss-js/rtcm3';

const decoder = new Rtcm3Decoder();
decoder.addData(chunk); // Uint8Array from NTRIP stream
for (const frame of decoder) {
  const msm = decodeMsmFull(frame); // MSM4-7 observations
  const eph = decodeEphemeris(frame); // broadcast ephemeris
}

Orbit computation

import { computeAllPositions, computeDop } from 'gnss-js/orbit';

const positions = computeAllPositions(ephemerides, times, receiverPosition);
// positions.prns: string[], positions.times: number[], positions.az/el/lat/lon: Float64Array

Signal analysis

import {
  MultipathAccumulator,
  CycleSlipAccumulator,
  CompletenessAccumulator,
} from 'gnss-js/analysis';

const mp = new MultipathAccumulator(header);
const cs = new CycleSlipAccumulator(header);
await parseRinexStream(stream, {
  onObservation: (time, prn, codes, values) => {
    mp.onObservation(time, prn, codes, values);
    cs.onObservation(time, prn, codes, values);
  },
});
const multipathResult = mp.finalize();
const cycleSlipResult = cs.finalize();

NTRIP client

import { fetchSourcetable, connectToMountpoint } from 'gnss-js/ntrip';

const table = await fetchSourcetable('https://proxy.example.com', {
  host: 'caster.example.com',
  port: 2101,
  version: '2.0',
});

const { reader, abort } = await connectToMountpoint(
  'https://proxy.example.com',
  {
    host: 'caster.example.com',
    port: 2101,
    mountpoint: 'MOUNT',
    username: 'user',
    password: 'pass',
    version: '2.0',
  }
);

Constants

import {
  C_LIGHT,
  FREQ,
  SYSTEM_NAMES,
  DUAL_FREQ_PAIRS,
} from 'gnss-js/constants';

FREQ['G']['1']; // 1575.42e6 Hz (GPS L1)
SYSTEM_NAMES['E']; // "Galileo"

Unit conventions

All functions use consistent units:

| Quantity | Unit | | ----------- | ---------------- | | Time values | milliseconds | | Angles | radians | | Distances | meters | | Frequencies | Hz |

Every exported function has JSDoc with @param and @returns annotations including explicit units.

Roadmap

  • Class-based API — Ergonomic wrappers like GnssTime.fromUtc(date).gps and Position.fromGeodetic(lat, lon, h).utm on top of the existing functional core
  • RINEX observation writers (RINEX 2/3/4 with gzip compression)

License

This project is dual-licensed:

  • AGPL-3.0 — Free for open-source projects. Any software that uses gnss-js must also be open-sourced under a compatible license.
  • Commercial license — For proprietary/closed-source use. Contact [email protected] for terms.