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 🙏

© 2025 – Pkg Stats / Ryan Hefner

radar-node

v1.0.0

Published

Node.js TypeScript library for communication and control with Echodyne radar panel

Readme

Radar-Node

A comprehensive TypeScript library for communication and control with Echodyne radar panels.

Features

  • Real-time Communication: HTTP and WebSocket clients for radar panel interaction
  • Data Processing: Advanced signal processing and target detection algorithms
  • Configuration Management: Complete radar system configuration control
  • Event-Driven Architecture: Real-time event handling and data streaming
  • TypeScript Support: Full type safety and IntelliSense support
  • Comprehensive Error Handling: Detailed error reporting and recovery mechanisms
  • Performance Monitoring: Built-in performance metrics and optimization

Installation

npm install radar-node

Quick Start

Basic Radar Client

import { RadarClient, ConnectionOptions } from 'radar-node';

const options: ConnectionOptions = {
  host: '192.168.1.100',
  port: 8080,
  timeout: 30000,
  retryAttempts: 3,
  authentication: {
    username: 'admin',
    password: 'password'
  }
};

const client = new RadarClient(options);

// Connect to radar panel
await client.connect();

// Start a radar scan
const scanId = await client.startScan({
  startAzimuth: -90,
  stopAzimuth: 90,
  startElevation: -30,
  stopElevation: 30,
  azimuthStep: 1,
  elevationStep: 1,
  dwellTime: 100
});

// Get detected targets
const targets = await client.getTargets();
console.log('Detected targets:', targets);

// Stop scan and disconnect
await client.stopScan();
await client.disconnect();

Real-time Data Streaming

import { RadarWebSocketClient, StreamType } from 'radar-node';

const wsClient = new RadarWebSocketClient({
  host: '192.168.1.100',
  port: 8081
});

// Connect to WebSocket
await wsClient.connect();

// Subscribe to target data stream
wsClient.subscribe({
  streamTypes: [StreamType.TARGETS, StreamType.STATUS],
  filters: [],
  sampling: { rate: 10, decimation: 1, averaging: 1 }
});

// Handle real-time data
wsClient.on('data', (packet) => {
  console.log('Received data packet:', packet);
});

wsClient.on('event', (event) => {
  console.log('Radar event:', event);
});

Configuration Management

import { RadarConfigManager } from 'radar-node';

const configManager = new RadarConfigManager(client);

// Load current configuration
const config = await configManager.loadConfiguration();

// Update scan parameters
await configManager.updateConfiguration(
  'scanning.defaultScanParams.dwellTime',
  150
);

// Validate configuration
const validation = configManager.validateConfiguration(config);
if (!validation.valid) {
  console.error('Configuration errors:', validation.errors);
}

Data Processing

import { RadarDataProcessor, ProcessingType } from 'radar-node';

const processor = new RadarDataProcessor({
  stages: [
    {
      name: 'FFT',
      type: ProcessingType.FFT,
      parameters: { size: 1024, window: 'hanning' },
      enabled: true
    },
    {
      name: 'CFAR Detection',
      type: ProcessingType.CFAR,
      parameters: { guardCells: 4, referenceCells: 16, threshold: 3.0 },
      enabled: true
    }
  ],
  parallelProcessing: false,
  bufferSizes: [1024, 1024]
});

// Process raw radar data
processor.on('targetDetected', (target) => {
  console.log('Target detected:', target);
});

const processedData = await processor.processRawData(rawData);

API Reference

RadarClient

The main client for communicating with the radar panel via HTTP.

Methods

  • connect(): Establish connection to radar panel
  • disconnect(): Close connection to radar panel
  • startScan(parameters): Start radar scanning
  • stopScan(): Stop current scan
  • getTargets(): Retrieve detected targets
  • calibrate(): Perform radar calibration
  • executeCommand(type, parameters): Execute custom commands

Events

  • connected: Connection established
  • disconnected: Connection lost
  • statusChanged: Radar status changed
  • targetDetected: New target detected
  • error: Error occurred

RadarWebSocketClient

WebSocket client for real-time data streaming.

Methods

  • connect(): Connect to WebSocket
  • disconnect(): Disconnect from WebSocket
  • subscribe(subscription): Subscribe to data streams
  • unsubscribe(streamTypes): Unsubscribe from streams
  • getStatistics(): Get streaming statistics

Events

  • connected: WebSocket connected
  • disconnected: WebSocket disconnected
  • data: Data packet received
  • event: Radar event received
  • error: Error occurred

RadarConfigManager

Configuration management for radar system.

Methods

  • loadConfiguration(): Load configuration from radar
  • saveConfiguration(config): Save configuration to radar
  • updateConfiguration(path, value): Update specific config value
  • validateConfiguration(config): Validate configuration
  • resetToDefaults(): Reset to default configuration

RadarDataProcessor

Advanced data processing and target detection.

Methods

  • processRawData(rawData): Process raw radar data
  • batchProcess(rawDataArray): Batch process multiple samples
  • updatePipeline(pipeline): Update processing pipeline
  • getPerformanceMetrics(): Get processing performance metrics

Events

  • processed: Data processing completed
  • targetDetected: Target detected in processed data
  • error: Processing error occurred

Configuration

Connection Options

interface ConnectionOptions {
  host: string;              // Radar panel IP address
  port: number;              // Connection port
  timeout: number;           // Connection timeout (ms)
  retryAttempts: number;     // Retry attempts on failure
  retryDelay: number;        // Delay between retries (ms)
  useSSL: boolean;           // Use SSL/TLS encryption
  authentication?: {
    username: string;
    password: string;
    apiKey?: string;
  };
}

Scan Parameters

interface ScanParameters {
  startAzimuth: number;      // Start azimuth angle (degrees)
  stopAzimuth: number;       // Stop azimuth angle (degrees)
  startElevation: number;    // Start elevation angle (degrees)
  stopElevation: number;     // Stop elevation angle (degrees)
  azimuthStep: number;       // Azimuth step size (degrees)
  elevationStep: number;     // Elevation step size (degrees)
  dwellTime: number;         // Dwell time per beam position (ms)
  frequency: number;         // Operating frequency (Hz)
  bandwidth: number;         // Signal bandwidth (Hz)
  txPower: number;           // Transmit power (dBm)
}

Error Handling

The library provides comprehensive error handling with specific error types:

import { 
  RadarError, 
  ConnectionError, 
  TimeoutError, 
  CommandError,
  isConnectionError 
} from 'radar-node';

try {
  await client.connect();
} catch (error) {
  if (isConnectionError(error)) {
    console.error('Connection failed:', error.message);
    console.error('Host:', error.details?.host);
    console.error('Port:', error.details?.port);
  }
}

Logging

Built-in logging system with configurable levels:

import { logger, LogLevel, setGlobalLogLevel } from 'radar-node';

// Set log level
setGlobalLogLevel(LogLevel.DEBUG);

// Use logger in your application
logger.info('Application started', 'MyApp');
logger.error('Error occurred', 'MyApp', error);

Performance Monitoring

Monitor performance metrics:

// Get client performance metrics
const stats = wsClient.getStatistics();
console.log('Data rate:', stats.dataRate);
console.log('Packet loss:', stats.droppedPackets / stats.totalPackets);

// Get processing performance
const procMetrics = processor.getPerformanceMetrics();
console.log('Processing time:', procMetrics.processingTime);
console.log('Throughput:', procMetrics.throughput);

Examples

See the examples/ directory for complete usage examples:

  • basic-client.ts - Basic radar client usage
  • realtime-streaming.ts - Real-time data streaming
  • configuration-management.ts - Configuration management
  • data-processing.ts - Advanced data processing
  • error-handling.ts - Error handling patterns

Development

Building

npm run build

Testing

npm test
npm run test:watch
npm run test:coverage

Linting

npm run lint
npm run lint:fix

License

MIT License - see LICENSE file for details.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Run linting and tests
  6. Submit a pull request

Support

For support and questions:

Changelog

See CHANGELOG.md for version history.