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

@gibme/port-forwarder

v22.0.0

Published

A simple port forward helper/service

Readme

Simple TCP Port Forwarding Server

A lightweight TCP port forwarding service for Node.js with session tracking, keepalive support, and both static and dynamic forwarding modes.

Requirements

  • Node.js >= 22

Installation

npm install @gibme/port-forwarder

or

yarn add @gibme/port-forwarder

Documentation

https://gibme-npm.github.io/port-forwarder/

Usage

Static Forwarding

Forward all incoming connections on a local port to a fixed remote host and port.

import PortForwarder from '@gibme/port-forwarder';

const server = new PortForwarder({
    port: 12345,
    remote: {
        ip: 'remotehost',
        port: 22
    }
});

await server.start();

Dynamic Forwarding

Handle each incoming connection individually and decide where to forward it at runtime.

import PortForwarder from '@gibme/port-forwarder';

const server = new PortForwarder({ port: 12345 });

server.on('connection', async (socket) => {
    if (await server.forward(socket, 'remotehost', 22)) {
        console.log('Forwarding established');
    } else {
        console.log('Forwarding failed');
    }
});

await server.start();

Configuration Options

| Option | Type | Default | Description | |---|---|---|---| | port | number | required | Local port to listen on | | ip | string | '0.0.0.0' | Local interface to bind to | | timeout | number | 900000 (15 min) | Socket timeout in milliseconds | | keepalive | boolean | false | Enable TCP keepalive on connections | | remote | { ip: string, port: number } | undefined | Remote endpoint for static forwarding |

Events

| Event | Parameters | Description | |---|---|---| | listening | (ip: string, port: number) | Emitted when the server starts listening | | close | | Emitted when the server closes | | connection | (socket: Socket, port: number) | Emitted on each incoming connection | | forward | (remoteAddress, remotePort, forwardAddress, forwardPort) | Emitted when a connection is forwarded | | error | (error: Error, ...args: any[]) | Emitted on error |

Session Tracking

Active forwarding sessions can be listed at any time:

const sessions = await server.list();

for (const session of sessions) {
    console.log(`${session.ip}:${session.port} -> ${session.forward.ip}:${session.forward.port}`);
}

Stopping the Server

await server.stop();

License

MIT