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

@lambdatest/node-tunnel

v4.0.11

Published

Nodejs bindings for LambdaTest Tunnel

Readme

TestMu AI Logo

TestMu AI Nodejs bindings for Tunnel

Node Tunnel health check

Installation

npm i @lambdatest/node-tunnel

Example

var lambdaTunnel = require('@lambdatest/node-tunnel');

//Creates an instance of Tunnel
var tunnelInstance = new lambdaTunnel();

// Replace <lambdatest-user> with your user and <lambdatest-accesskey> with your key.
var tunnelArguments = {
  user: process.env.LT_USERNAME || '<lambdatest-user>',
  key: process.env.LT_ACCESS_KEY || '<lambdatest-accesskey>'
};

// Callback Style
// Atarts the Tunnel instance with the required arguments
tunnelInstance.start(tunnelArguments, function(error, status) {
  if (!error) {
    console.log('Tunnel is Running Successfully');
  }
});

// Promise Style
tunnelInstance
  .start(tunnelArguments)
  .then(status => {
    console.log('Tunnel is Running Successfully');
  })
  .catch(error => {
    console.log(error);
  });

// Async/Await Style
(async function() {
  try {
    const istunnelStarted = await tunnelInstance.start(tunnelArguments);
    console.log('Tunnel is Running Successfully');
  } catch (error) {
    console.log(error);
  }
})();

Methods

tunnelInstance.start(tunnelArguments, callback)

Start tunnel Instance.

  • tunnelArguments: credentials for secure tunnel connection.
    • user: The username for the TestMu AI account.
    • key: The accessKey for the TestMu AI account.
  • callback (function(error, status)): A callback to invoke when the API call is complete.
// Callback Style
tunnelInstance.start(tunnelArguments, function(error, status) {
  if (!error) {
    console.log('Tunnel is Running Successfully');
  }
});

// Promise Style
tunnelInstance
  .start(tunnelArguments)
  .then(status => {
    console.log('Tunnel is Running Successfully');
  })
  .catch(error => {
    console.log(error);
  });

// Async/Await Style
(async function() {
  try {
    const istunnelStarted = await tunnelInstance.start(tunnelArguments);
    console.log('Tunnel is Running Successfully');
  } catch (error) {
    console.log(error);
  }
})();

tunnelInstance.isRunning()

Get Status of tunnel Instance.

// Callback Style
tunnelInstance.start(tunnelArguments, function(error, status) {
  if (!error) {
    console.log('Tunnel is Running Successfully');
    var tunnelRunningStatus = tunnelInstance.isRunning();
    console.log('Tunnel is Running ? ' + tunnelRunningStatus);
  }
});

// Promise Style
tunnelInstance
  .start(tunnelArguments)
  .then(status => {
    console.log('Tunnel is Running Successfully');
    const tunnelRunningStatus = tunnelInstance.isRunning();
    console.log('Tunnel is Running ? ' + tunnelRunningStatus);
  })
  .catch(error => {
    console.log(error);
  });

// Async/Await Style
(async function() {
  try {
    const istunnelStarted = await tunnelInstance.start(tunnelArguments);
    console.log('Tunnel is Running Successfully');
    const tunnelRunningStatus = tunnelInstance.isRunning();
    console.log('Tunnel is Running ? ' + tunnelRunningStatus);
  } catch (error) {
    console.log(error);
  }
})();

tunnelInstance.getTunnelName(callback)

Get name of the Running tunnel Instance.

  • callback (function(tunnelName)): A callback to invoke when the API call is complete.
// Callback Style
tunnelInstance.start(tunnelArguments, function(error, status) {
  if (!error) {
    console.log('Tunnel is Running Successfully');
    tunnelInstance.getTunnelName(function(tunnelName) {
      console.log('Tunnel Name : ' + tunnelName);
    });
  }
});

// Promise Style
tunnelInstance
  .start(tunnelArguments)
  .then(status => {
    console.log('Tunnel is Running Successfully');
    tunnelInstance.getTunnelName().then(tunnelName => {
      console.log('Tunnel Name : ' + tunnelName);
    });
  })
  .catch(error => {
    console.log(error);
  });

// Async/Await Style
(async function() {
  try {
    const istunnelStarted = await tunnelInstance.start(tunnelArguments);
    console.log('Tunnel is Running Successfully');
    const tunnelName = await tunnelInstance.getTunnelName();
    console.log('Tunnel Name : ' + tunnelName);
  } catch (error) {
    console.log(error);
  }
})();

tunnelInstance.stop(callback)

Stop the Running tunnel Instance.

  • callback (function(error, status)): A callback to invoke when the API call is complete.
// Callback Style
tunnelInstance.start(tunnelArguments, function(error, status) {
  if (!error) {
    console.log('Tunnel is Running Successfully');
    tunnelInstance.stop(function(error, status) {
      console.log('Tunnel is Stopped ? ' + status);
    });
  }
});

// Promise Style
tunnelInstance
  .start(tunnelArguments)
  .then(status => {
    console.log('Tunnel is Running Successfully');
    tunnelInstance.stop().then(status => {
      console.log('Tunnel is Stopped ? ' + status);
    });
  })
  .catch(error => {
    console.log(error);
  });

// Async/Await Style
(async function() {
  try {
    const istunnelStarted = await tunnelInstance.start(tunnelArguments);
    console.log('Tunnel is Running Successfully');
    const status = await tunnelInstance.stop();
    console.log('Tunnel is Stopped ? ' + status);
  } catch (error) {
    console.log(error);
  }
})();

Arguments

Every modifier except user and key is optional. Visit TestMu AI tunnel modifiers for an entire list of modifiers. Below are demonstration of some modifiers for your reference.

TestMu AI Basic Credentials

Below credentials will be used to perform basic authentication of your TestMu AI account.

  • user (Username of your TestMu AI account)
  • key (Access Key of your TestMu AI account)

Port

If you wish to connect tunnel on a specific port.

  • port : (optional) Local port to connect tunnel.
tunnelArguments = {
  user: process.env.LT_USERNAME || '<lambdatest-user>',
  key: process.env.LT_ACCESS_KEY || '<lambdatest-accesskey>',
  port: '<port>'
};

Proxy

If you wish to perform tunnel testing using a proxy.

  • proxyhost: Hostname/IP of proxy, this is a mandatory value.
  • proxyport: Port for the proxy, by default it would consider 3128 if proxyhost is used For Basic Authentication, we use the below proxy options:
  • proxyuser: Username for connecting to proxy, mandatory value for using 'proxypass'
  • proxypass: Password for the USERNAME option.
tunnelArguments = {
  user: process.env.LT_USERNAME || '<lambdatest-user>',
  key: process.env.LT_ACCESS_KEY || '<lambdatest-accesskey>',
  proxyHost: '127.0.0.1',
  proxyPort: '8000',
  proxyUser: 'user',
  proxyPass: 'password'
};

Tunnel Name

Human readable tunnel identifier

  • tunnelName: (Name of the tunnel)
tunnelArguments = {
  user: process.env.LT_USERNAME || '<lambdatest-user>',
  key: process.env.LT_ACCESS_KEY || '<lambdatest-accesskey>',
  tunnelName: '<your-tunnel-name>'
};

Testing Local Folder

Populate the path of the local folder you want to test in your internal server as a value in the below modifier.

  • dir/localdir/localdirectory : Path of the local folder you want to test
tunnelArguments = {
  user: process.env.LT_USERNAME || '<lambdatest-user>',
  key: process.env.LT_ACCESS_KEY || '<lambdatest-accesskey>',
  dir: '<path of the local folder you want to test>'
};

Enable Verbose Logging

To log every request to stdout.

  • v/verbose : true or false
tunnelArguments = {
  user: process.env.LT_USERNAME || '<lambdatest-user>',
  key: process.env.LT_ACCESS_KEY || '<lambdatest-accesskey>',
  v: true
};

Additional Arguments

Logfile You can provide a specific path to this file. If you won't provide a path then the logs would be saved in your present working directory by the filename: tunnel.log. For providing a specific path use the below argument:

  • logFile : path
tunnelArguments = {
  user: process.env.LT_USERNAME || '<lambdatest-user>',
  key: process.env.LT_ACCESS_KEY || '<lambdatest-accesskey>',
  logFile: '/lambdatest/logs.txt'
};
  • egressOnly: Uses proxy settings only for outbound requests.
  • ingressOnly: Uses proxy settings only for inbound requests.
  • dns: Comma separated list of dns servers
  • sshConnType: Specify type of ssh connection (over_22, over_443, over_ws)
  • mode: Specifies in which mode tunnel should run [ssh,ws]
  • nows: Force tunnel to run in non websocket mode
  • mitm: MITM mode, used for testing websites with private certificates

Contribute

Reporting bugs

Our GitHub Issue Tracker will help you log bug reports.

Tips for submitting an issue: Keep in mind, you don't end up submitting two issues with the same information. Make sure you add a unique input in every issue that you submit. You could also provide a "+1" value in the comments.

Always provide the steps to reproduce before you submit a bug. Provide the environment details where you received the issue i.e. Browser Name, Browser Version, Operating System, Screen Resolution and more. Describe the situation that led to your encounter with bug. Describe the expected output, and the actual output precisely.

Pull Requests

We don't want to pull breaks in case you want to customize your TestMu AI experience. Before you proceed with implementing pull requests, keep in mind the following. Make sure you stick to coding conventions. Once you include tests, ensure that they all pass. Make sure to clean up your Git history, prior your submission of a pull-request. You can do so by using the interactive rebase command for committing and squashing, simultaneously with minor changes + fixes into the corresponding commits.

About TestMu AI

TestMu AI (formerly LambdaTest) is a full-stack, agentic AI quality engineering platform that helps teams test smarter and ship faster. Built AI-native from the ground up, it provides end-to-end AI agents that can plan, author, execute, and analyze software testing across the entire development lifecycle.

Designed for scale, TestMu AI enables seamless testing of web, mobile, and enterprise applications on real devices, real browsers, and customizable real-world environments—empowering teams to deliver high-quality releases with speed and confidence.

It's a perfect solution to bring your selenium automation testing to cloud based infrastructure that not only helps you increase your test coverage over multiple desktop and mobile browsers, but also allows you to cut down your test execution time by running tests on parallel.