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

rgtp

v3.0.2

Published

Red Giant Transport Protocol - High-performance UDP-based transport protocol

Readme

Red Giant Transport Protocol (RGTP) - Node.js Bindings

High-performance UDP-based transport protocol for Node.js with full JavaScript API.

Key Features:

  • Session/Client Architecture - Event-driven file transfer
  • Progress Tracking - Real-time transfer monitoring
  • Configuration Presets - Optimized for LAN/WAN/mobile
  • Cross-platform - Works on Windows, macOS, and Linux
  • Native Performance - Built on proven C core implementation

License: MIT NPM Version Build Status

Installation

Quick Install

npm install rgtp

Prerequisites

  • Node.js 14.0.0 or higher
  • npm 6.0.0 or higher
  • Build tools (automatically installed on most systems)

The package includes pre-built binaries for major platforms.

Quick Start

Server Side (Expose a File)

const rgtp = require('rgtp');

// Create server session
const session = new rgtp.Session({
  port: 9999,
  adaptiveMode: true
});

// Listen for events
session.on('exposeStart', (filePath, fileSize) => {
  console.log(`Exposing ${filePath} (${fileSize} bytes)`);
});

session.on('progress', (transferred, total) => {
  const percent = ((transferred / total) * 100).toFixed(1);
  console.log(`Progress: ${percent}%`);
});

session.on('error', (error) => {
  console.error('Error:', error.message);
});

// Expose file
await session.exposeFile('large-file.bin');
console.log('File exposed successfully!');

// Get statistics
const stats = await session.getStats();
console.log(`Transferred: ${rgtp.formatBytes(stats.bytesTransferred)}`);
console.log(`Throughput: ${stats.avgThroughputMbps.toFixed(2)} MB/s`);

// Cleanup
session.close();

Client Side (Pull a File)

const rgtp = require('rgtp');

// Create client
const client = new rgtp.Client({
  timeout: 30000
});

// Listen for events
client.on('pullStart', (host, port, outputPath) => {
  console.log(`Downloading from ${host}:${port} to ${outputPath}`);
});

client.on('progress', (transferred, total) => {
  const percent = ((transferred / total) * 100).toFixed(1);
  console.log(`Download progress: ${percent}%`);
});

client.on('pullComplete', (outputPath) => {
  console.log(`Download complete: ${outputPath}`);
});

// Pull file
await client.pullToFile('192.168.1.100', 9999, 'downloaded-file.bin');
console.log('File downloaded successfully!');

// Get statistics
const stats = await client.getStats();
console.log(`Received: ${rgtp.formatBytes(stats.bytesTransferred)}`);

// Cleanup
client.close();

Convenience Functions

For simple use cases:

const rgtp = require('rgtp');

// Send a file (one-liner)
const sendStats = await rgtp.sendFile('my-file.bin', { port: 9999 });

// Receive a file (one-liner)
const receiveStats = await rgtp.receiveFile('host', 9999, 'output.bin');

Configuration Presets

const rgtp = require('rgtp');

// High-bandwidth LAN
const lanSession = new rgtp.Session(rgtp.createLANConfig());

// Variable bandwidth WAN
const wanClient = new rgtp.Client(rgtp.createWANConfig());

// Mobile/limited bandwidth
const mobileSession = new rgtp.Session(rgtp.createMobileConfig());

API Reference

RGTPSession

Constructor:

new rgtp.Session(options)

Options:

  • port - Port to listen on (0 = auto)
  • chunkSize - Chunk size in bytes (default: 1MB)
  • adaptiveMode - Enable adaptive rate control (default: true)
  • timeout - Operation timeout in ms (default: 30000)

Methods:

  • exposeFile(filePath) - Expose a file for transfer
  • waitComplete() - Wait for all transfers to complete
  • getStats() - Get transfer statistics
  • close() - Close the session

Events:

  • exposeStart - File exposure started
  • progress - Transfer progress update
  • error - Error occurred
  • close - Session closed

RGTPClient

Constructor:

new rgtp.Client(options)

Options:

  • timeout - Connection timeout in ms (default: 30000)
  • chunkSize - Preferred chunk size (default: 1MB)
  • adaptiveMode - Enable adaptive mode (default: true)

Methods:

  • pullToFile(host, port, outputPath) - Pull file from server
  • getStats() - Get transfer statistics
  • close() - Close the client

Events:

  • pullStart - File download started
  • progress - Download progress update
  • pullComplete - Download completed
  • error - Error occurred
  • close - Client closed

Examples

Run the included examples:

# Simple transfer demo
npm run example

# Server demo
npm run examples:server

# Client demo
npm run examples:client

Performance Tips

  1. Chunk Size: Adjust based on network conditions
  2. Adaptive Mode: Keep enabled for optimal performance
  3. Event Handling: Use progress events for real-time feedback
  4. Error Handling: Always wrap operations in try-catch blocks

License

MIT - See LICENSE file for details.

Contributing

Contributions welcome! Please read CONTRIBUTING.md for guidelines.

Support

For issues and questions, please open an issue on GitHub.