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

@fourscore/sdr

v1.1.0

Published

A browser-native TypeScript client for both KiwiSDR and OpenWebRX receivers.

Downloads

451

Readme

@fourscore/sdr

A browser-native TypeScript client for both KiwiSDR and OpenWebRX receivers.

The public API is intentionally small: use a single UniversalSDR class, choose the backend with 'kiwisdr' | 'openwebrx', and receive everything through callbacks.

Installation

npm install @fourscore/sdr
# or
yarn add @fourscore/sdr

Quick Start

import { UniversalSDR } from '@fourscore/sdr';

const sdr = new UniversalSDR('kiwisdr', {
  host: 'sdr.example.com',
  onOpen: () => console.log('connected'),
  onAudio: ({ samples }) => {
    console.log('pcm samples', samples.length);
  },
  onWaterfall: ({ bins }) => {
    console.log('waterfall bins', bins.length);
  },
  onSMeter: (rssi) => {
    console.log('signal', rssi);
  },
  onError: (error) => {
    console.error(error);
  },
});

sdr.connect({
  frequency: 7200,
  mode: 'lsb',
  zoom: 0,
  centerFreq: 15000,
});

API

new UniversalSDR(type, options)

const kiwi = new UniversalSDR('kiwisdr', {
  host: 'kiwi.example.com',
  port: 8073,
  onAudio: ({ samples }) => { /* ... */ },
});

const owrx = new UniversalSDR('openwebrx', {
  host: 'openwebrx.example.com',
  onConfig: (config) => { /* ... */ },
});

options supports:

  • host: hostname or host:port
  • port: optional explicit port
  • password: KiwiSDR password
  • username: optional client name
  • onOpen
  • onClose
  • onAudio
  • onWaterfall
  • onError
  • onSMeter
  • onConfig

sdr.connect(options)

Starts audio and waterfall handling for the selected backend.

sdr.connect({
  frequency: 10125,
  mode: 'usb',
  lowCut: 300,
  highCut: 2700,
  sampleRate: 12000,
  agc: true,
  zoom: 2,
  centerFreq: 10125,
});

Common options:

  • frequency: tuned frequency in kHz
  • mode: audio mode
  • lowCut / highCut: passband edges in Hz
  • sampleRate: requested output rate
  • zoom: waterfall zoom level
  • centerFreq: waterfall center in kHz

KiwiSDR-specific optional controls:

  • agc
  • agcHang
  • agcThresh
  • agcSlope
  • agcDecay
  • manGain
  • compression
  • squelch
  • squelchMax
  • maxDb
  • minDb
  • speed
  • waterfallCompression

OpenWebRX-specific note:

  • squelch may be passed as a dB value when using the openwebrx backend

Methods

sdr.tune(7100);            // retune and auto-center the waterfall when needed
sdr.setMode('lsb');        // applies MODE_CUTS defaults for the mode
sdr.adjustZoom(1);         // zoom in around the current tuned frequency
sdr.setAgc(false, 60);      // KiwiSDR only
sdr.toggleAgc();            // KiwiSDR only
sdr.setWaterfallView(4, 7100);
sdr.selectProfile('rtlsdr|am'); // OpenWebRX only
sdr.close();

getStatus() is also available for KiwiSDR connections.

Callback Payloads

onAudio

interface AudioData {
  samples: Int16Array;
  rssi: number;
  sequence: number;
  flags: number;
  gps?: GPSTimestamp;
}

onWaterfall

interface WaterfallData {
  bins: Uint8Array | Float32Array;
  sequence: number;
  xBin: number;
  zoom: number;
  flags: number;
}

onConfig

interface SDRConfig {
  type: 'kiwisdr' | 'openwebrx';
  frequency: number;
  mode: AudioMode;
  lowCut: number;
  highCut: number;
  agc?: boolean;
  centerFreq: number;
  bandwidth: number;
  viewCenterFreq: number;
  viewBandwidth: number;
  zoom: number;
  waterfallMin: number;
  waterfallMax: number;
  fftSize: number;
  audioCompression?: string;
  fftCompression?: string;
  profileId?: string;
  profileChanged?: boolean;
  startFreq?: number;
  startMode?: AudioMode;
  profiles?: SDRProfile[];
  activeProfileId?: string;
}

All frequency values in SDRConfig are reported in kHz.

Audio Modes

AUDIO_MODES and MODE_CUTS are exported for clients that want sensible defaults for tuning UI.

Browser Compatibility

Requires browser support for WebSocket, fetch, TextDecoder, and DataView.

License

MIT