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 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-sauce-connect

v4.5.0

Published

Downloader of sauce connect executable on install time

Downloads

18

Readme

Build Status Build status Code Climate npm npm version

Node Sauce Connect

Note

The reason for creating this package was I'm working in an enterprise environment and I wanted a simple way to grab sauce connect from a local nexus repository on npm install. sauce-connect-launcher does this but felt extremely heavyweight and there was no way to specify where to download from.

Installing

npm install node-sauce-connect

Custom Binary Download Url

To use a mirror of the Sauce Connect binaries use npm config property sauceconnect_cdnurl. Default is https://saucelabs.com/downloads.

npm install node-sauce-connect --sauceconnect_cdnurl=https://your.url/sauceconnect

Or add property into your .npmrc file.

sauceconnect_cdnurl=https://your.url/sauceconnect

Custom Certificate Authority

Sometimes on internal networks certificates are self signed by the organization which causes errors when downloading. You can use the the following .npmrc config settings to force node-sauce-connect to trust these certificate authorities.

cafile=/path/to/certificate.crt

You can also provide the certificate as a string to node-sauce-connect by using the ca setting

ca="-----BEGIN CERTIFICATE-----\nMIID0zCCArugAwIBAgI...."

Disable Strict SSL Mode

Strict SSL environment variables are also respected, this means node-sauce-connect will ignore any SSL errors that are thrown when downloading when the strict-ssl property is in your .npmrc file.

strict-ssl=false

Obfuscation of HTTP(S)_PROXY basic auth

On install node-sauce-connect will log out the HTTP_PROXY and HTTPS_PROXY env vars to help in debugging. By default it obfuscates the username and password. If you require to see what is being used then

npm install node-sauce-connect --node_sauce_connect_debug=TRUE

Or add property into your .npmrc file.

node_sauce_connect_debug=TRUE

Running

bin/sc [arguments]

If installed via npm there will be a symlink placed in node_modules/.bin you can execute by placing the following in your package.json file.

{
    "scripts": {
      "test": "npm run sc && [test util]",
      "sc": "sc [arguments]"
    }
}

Running via Node

The package exports a path string that contains the path to the Sauce Connect binary/executable.

Below is an example of using this package via node.

var childProcess = require('child_process');
var sauceConnect = require('node-sauce-connect');
var binPath = sauceConnect.path;

var childArgs = [
    // optional arguments
];

function logger(data) {
  console.log(data);
}

var instance = childProcess.spawn(binPath, childArgs);

instance.stdout.on('data', logger);                   
instance.on('data', logger);

// run your tests

instance.kill();

You can also use the start and stop methods for convenience (this only works for one instance):

var sauceConnect = require('node-sauce-connect');

args = [
	// optional arguments
];

function logger(data) {
  console.log(data);
}

sauceConnect.start(args);

sauceConnect.defaultInstance.stdout.on('data', logger);                   
sauceConnect.defaultInstance.on('data', logger);

// run your tests

sauceConnect.stop();

Note: if your tests are ran asynchronously, sauceConnect.stop() will have to be executed as a callback at the end of your tests.

Versioning

The NPM package version tracks the version of Sauce Connect that will be installed, there is also the possibility of an additional number (eg. 4.5.51) that will be used used for revisions to the installer.

Node Version Support

The package has been tested with latest versions of Node 4, 5, 6, 7, 8 and 9.

Author

Barry Allwood

This project is completely inspired by and borrows heavily from the chromedriver project (even the readme) and sauce-connect-launcher project.

License

Licensed under the Apache License, Version 2.0.