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

browserstack-parallel-check

v1.0.1

Published

Polls the BrowserStack parallel/queue usage API to dynamically allocate available workers for Playwright tests.

Readme

browserstack-parallel-check

browserstack-parallel-check polls the BrowserStack parallel/queue usage API to dynamically allocate available workers for your test suites (e.g., Playwright, Cypress, Jest).

It intelligently waits until there is sufficient capacity based on your configured minimum requirements. Once capacity is found, it injects BROWSERSTACK_WORKERS and BROWSERSTACK_PARALLELS_PER_PLATFORM into the environment and seamlessly executes the test command you specify.

Installation

Globally (Recommended for CLI usage)

npm install -g browserstack-parallel-check

Locally in your project

npm install browserstack-parallel-check --save-dev

Usage

You can run browserstack-parallel-check followed by any Node-based test command. If no test command is provided, it will simply set up the environment variables, verify the capacity, and exit successfully (useful for dry runs).

Examples

Verifying Capacity Only (No Test Command): If you want to only verify capacity and set up environment variables (e.g. for a dry run), simply omit the test command:

npx browserstack-parallel-check -u YOUR_USERNAME -k YOUR_ACCESS_KEY

Running a Playwright Test:

npx browserstack-parallel-check -u YOUR_USERNAME -k YOUR_ACCESS_KEY browserstack-node-sdk playwright test

Running a Custom Test Command (e.g., Cypress):

npx browserstack-parallel-check -u YOUR_USERNAME -k YOUR_ACCESS_KEY cypress run --browser chrome

Using Environment Variables: You can set options using environment variables instead of flags:

BROWSERSTACK_USERNAME=yourUser BROWSERSTACK_ACCESS_KEY=yourKey BROWSERSTACK_MIN_WORKERS=2 npx browserstack-parallel-check npm run test:e2e

Configuration Options

You can configure the tool using command-line flags or environment variables. The script will automatically fall back to the environment variables if the flags are not provided.

| Option | Env Variable | Default | Description | |---|---|---|---| | -u, --username <type> | BROWSERSTACK_USERNAME | (Required) | BrowserStack username | | -k, --access-key <type> | BROWSERSTACK_ACCESS_KEY | (Required) | BrowserStack access key | | --min-workers <number> | BROWSERSTACK_MIN_WORKERS | 1 | Minimum parallels required | | --max-workers <number> | BROWSERSTACK_MAX_WORKERS | 2 | Maximum parallels to allocate | | --poll-timeout <number> | BROWSERSTACK_POLL_TIMEOUT_SEC | 1800 | Total seconds to keep polling before giving up | | -h, --help | N/A | N/A | Display help for command |

Behavior

Upon execution, the script will:

  1. Print the considered minimum and maximum parallels.
  2. Check the BrowserStack API for available capacity.
  3. If capacity is below the minimum, it will poll every 5 minutes until the poll-timeout is reached.
  4. Once capacity is found, it calculates the optimal worker count and executes your provided test command.