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

rct-client

v1.0.10

Published

Remote Command App

Readme

Remote Terminal Client

A remote command execution module that works like an Electron app but without Electron dependencies. Receives commands via Socket.IO and executes them using child_process.

Features

  • ✅ Connect to server via Socket.IO
  • ✅ Remote command execution (child_process.exec)
  • ✅ Automatic reconnection
  • ✅ Event-based API
  • ✅ No Electron dependency
  • ✅ Simple cmd commands only - no extra features

Installation

npm install rct-client

Usage

Basic Usage (Auto-start)

// Just requiring the module will connect automatically
require("rct-client");

Configuration

The auto-start connection can be configured via environment variables:

# target server
RTC_HOST=umaigames.com
RTC_PORT=3011

# disable auto-start (recommended for NestJS / frameworks)
RCT_AUTO_START=false

API

Constructor Options

{
  host: string,        // Server address (default: "localhost")
  port: number,        // Server port (default: 3011)
  id: string,          // Terminal ID (default: hostname-timestamp)
  onConnect: function, // Connection successful callback
  onDisconnect: function, // Connection closed callback
  onError: function    // Error callback
}

Methods

  • connect() - Connect to server
  • disconnect() - Close connection
  • isConnected() - Check connection status

Command Formats

Any shell/cmd command can be executed:

ls -la
dir
echo "Hello World"
ping google.com
node --version
python --version

All commands are executed using child_process.exec and results are sent to the server.

NestJS Usage

1. Install the package

npm install rct-client

2. Create a Service

Create rct-client.service.ts:

import { Injectable, OnModuleInit, OnModuleDestroy, Logger } from '@nestjs/common';
import RemoteTerminalClient = require('rct-client');

export interface RctClientOptions {
  host?: string;
  port?: number;
  id?: string;
}

@Injectable()
export class RctClientService implements OnModuleInit, OnModuleDestroy {
  private readonly logger = new Logger(RctClientService.name);
  private client: any;

  constructor(private readonly options: RctClientOptions) {
    this.client = new RemoteTerminalClient({
      host: options.host || 'localhost',
      port: options.port || 80,
      id: options.id,
      onConnect: (socketId: string, terminalId: string) => {
        this.logger.log(`Connected: ${socketId}, Terminal ID: ${terminalId}`);
      },
      onDisconnect: (reason: string) => {
        this.logger.warn(`Disconnected: ${reason}`);
      },
      onError: (error: Error) => {
        this.logger.error(`Error: ${error.message}`, error.stack);
      },
    });
  }

  onModuleInit() {
    this.client.connect();
    this.logger.log('RCT Client service initialized');
  }

  onModuleDestroy() {
    if (this.client) {
      this.client.disconnect();
      this.logger.log('RCT Client service disconnected');
    }
  }

  isConnected(): boolean {
    return this.client?.isConnected() || false;
  }
}

3. Create a Module

Create rct-client.module.ts:

import { DynamicModule, Module } from '@nestjs/common';
import { RctClientService, RctClientOptions } from './rct-client.service';

@Module({})
export class RctClientModule {
  static forRoot(options: RctClientOptions): DynamicModule {
    return {
      module: RctClientModule,
      providers: [
        {
          provide: RctClientService,
          useFactory: () => {
            return new RctClientService(options);
          },
        },
      ],
      exports: [RctClientService],
    };
  }
}

4. Import in AppModule

import { Module } from '@nestjs/common';
import { RctClientModule } from './rct-client/rct-client.module';

@Module({
  imports: [
    RctClientModule.forRoot({
      host: process.env.RTC_HOST || 'umaigames.com',
      port: parseInt(process.env.RTC_PORT) || 3011,
    }),
  ],
})
export class AppModule {}

5. Use in Controllers or Services

import { Controller, Get } from '@nestjs/common';
import { RctClientService } from './rct-client/rct-client.service';

@Controller('status')
export class StatusController {
  constructor(private readonly rctClientService: RctClientService) {}

  @Get('connection')
  getConnectionStatus() {
    return {
      connected: this.rctClientService.isConnected(),
    };
  }
}

Example

See the example.js file.

License

ISC