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

testingbot-tunnel-launcher

v1.1.20

Published

A wrapper around TestingBot's Tunnel

Readme

testingbot-tunnel-launcher

npm Tests

A library to download and launch TestingBot Tunnel.

Installation

npm install testingbot-tunnel-launcher

Usage

Simple Usage (Callback)

const testingbotTunnel = require('testingbot-tunnel-launcher');

testingbotTunnel({
  apiKey: process.env.TB_KEY,
  apiSecret: process.env.TB_SECRET,
  verbose: true
}, function (err, tunnel) {
  if (err) {
    console.error(err.message);
    return;
  }
  console.log("Tunnel ready");

  tunnel.close(function () {
    console.log("Tunnel closed completely");
  })
});

Simple Usage (Async/Await)

const testingbotTunnel = require('testingbot-tunnel-launcher');

async function runTests() {
  try {
    const tunnel = await testingbotTunnel.downloadAndRunAsync({
      apiKey: process.env.TB_KEY,
      apiSecret: process.env.TB_SECRET,
      verbose: true
    });
    console.log("Tunnel ready");

    // Run your tests here...

    // Close the tunnel when done
    await testingbotTunnel.killAsync();
    console.log("Tunnel closed completely");
  } catch (err) {
    console.error(err.message);
  }
}

runTests();

Options

const testingbotTunnel = require('testingbot-tunnel-launcher')
const options = {
  // The TestingBot API key which you can get for free, listed in the TestingBot member area
  apiKey: 'key',

  // The TestingBot API secret which you can get for free, listed in the TestingBot member area
  apiSecret: 'secret',

  // More verbose output from the tunnel
  verbose: true,

  // Port on which the tunnel Selenium relay will listen for
  // requests. Default 4445. (optional)
  'se-port': 4445,

  // Proxy host and port the tunnel can use to connect to an upstream proxy
  // e.g. "localhost:1234" (optional)
  proxy: null,

  // A comma-separated list of domains that
  // will not go through the tunnel. (optional)
  'fast-fail-regexps': null,

  // Write logging output to this logfile (optional)
  logfile: null,

  // Change the tunnel version - see versions on https://testingbot.com/support/other/tunnel/changelog.html
  tunnelVersion: "4.0",

  // Gives this tunnel a unique identifier
  tunnelIdentifier: "myIdentifier",

  // Share this tunnel with other team members on TestingBot
  shared: true,

  // Timeout in seconds for the tunnel to start (default: 90)
  timeout: 120,

  // Disable SSL bumping/rewriting
  noBump: false,

  // Disable caching
  noCache: false
};

testingbotTunnel(options, function(err, tunnel) {
  console.log("Started Tunnel");
  tunnel.close(function () {
    console.log("Closed tunnel");
  });
});

Credentials

You can pass the TestingBot credentials as apiKey and apiSecret in the options.

You can also create a ~/.testingbot file in your $HOME directory, with apiKey:apiSecret as contents.

The credentials are handed to the tunnel through the TESTINGBOT_KEY and TESTINGBOT_SECRET environment variables instead of the command line, so they do not show up in the process list. They are also redacted from the output when verbose is enabled.

Running more than one tunnel

Every tunnel keeps its own state, so several tunnels can run next to each other. Give each one its own tunnelIdentifier and hold on to the tunnel you get back to close it:

const first = await testingbotTunnel.downloadAndRunAsync({ ...options, tunnelIdentifier: 'first' });
const second = await testingbotTunnel.downloadAndRunAsync({ ...options, tunnelIdentifier: 'second' });

first.close();
await testingbotTunnel.killAllAsync();

killAsync closes the tunnel that was started last, killAllAsync closes all of them and activeTunnels() returns the ones that are still running.

Where the tunnel is stored

The tunnel jar is downloaded into the directory of this package. When that directory can not be written to, which is the case for global installs and read-only images, it is stored in the cache directory of the user (~/.cache/testingbot-tunnel-launcher on Linux, ~/Library/Caches/testingbot-tunnel-launcher on macOS and %LOCALAPPDATA% on Windows).

Set TESTINGBOT_TUNNEL_CACHE_DIR to store the jar somewhere else.

Testing

npm test

MIT license

Copyright (c) TestingBot <[email protected]>