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

browser-driver-manager

v1.0.4

Published

A cli for managing Chrome and Firefox browsers and drivers. Especially useful to keep Chrome and Chromedriver in-sync.

Downloads

802

Readme

browser-driver-manager

A cli for managing Chrome browsers and drivers. Especially useful to keep Chrome and ChromeDriver versions in-sync for continuous integration.

Installation

npm install browser-driver-manager

Usage

npx browser-driver-manager install chrome chromedriver

Managing browsers and drivers for continuous integration, especially Chrome and ChromeDriver, can be extremely difficult, if not utterly frustrating.

Take for example the following real world scenario.

You need Chrome and ChromeDriver installed on your continuous integration system in order to run your tests. Most continuous integration systems come pre-installed with Chrome and other browsers. This is great until you need to install ChromeDriver yourself (e.g. as an npm package).

If you try to pin to a specific version, your test setup will eventually break because Chrome gets updated by the system whereas ChromeDriver remains pinned. This means that as soon as Chrome is out-of-sync with the ChromeDriver version, you end up with the infamous message:

SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version <version>`

So instead you decided to pin to the @latest tag. This works great as now both Chrome and ChromeDriver are the latest version. However, this also can break if the continuous integration system does not install the latest version right away but ChromeDriver releases the latest. Now your versions are out-of-sync again and you're back at square one.

This is why this package exists. It will help keep the versions of Chrome and ChromeDriver in-sync so that your continuous integration system tests don't fail due to ChromeDriver versions.

So now instead of relying on pinning, you can ask the system which version of Chrome is installed and always get the version of ChromeDriver that matches. This will even work for Chrome channels that are not just Stable (i.e. Beta, Dev, and Canary).

Here's an example of doing just that in an npm script.

{
  "scripts": {
    "install:chromedriver": "browser-driver-manager install chromedriver"
  }
}

If you wanted to install Chrome Beta and its associated driver:

{
  "scripts": {
    "install:chromedriver": "browser-driver-manager install chrome=beta chromedriver=beta"
  }
}

Supported Platforms and Browsers

Currently only MacOS and Linux platforms, and Chrome browser and drivers are supported. Firefox support is planned.

Currently there are no plans to support Windows. If you need Windows support please reach out, but understand that adding Windows support is a paid feature request.

System Requirements

Using the version or which commands do not require any bash built in commands. The install bash command requires the following support:

  • curl or wget to download files
  • dpkg or rpm to extract browser applications
  • apt or yum to install browsers
  • unzip to install ChromeDriver (if using the bash script directly)

Additionally, sudo permissions are needed in order to install browsers.

Commands and Options

Commands

  • install: Install one or multiple browsers or drivers Can also pass the specific browser channel or driver version for each browser or driver. The latest Stable channel is used if no channel is passed. When installing ChromeDriver without passing a channel or version, the ChromeDriver version that matches the installed Stable version of Chrome is used.

    # Install latest Chrome Stable
    browser-driver-manager install chrome
    
    # Install ChromeDriver version that matches install Chrome Stable
    browser-driver-manager install chromedriver    
    
    # Install latest Chrome Beta
    browser-driver-manager install chrome=beta
    
    # Install ChromeDriver version 97
    browser-driver-manager install chromedriver=97
    
    # Install both Chrome and ChromeDriver Beta
    browser-driver-manager install chrome=beta chromedriver=beta
  • version: Get the installed version of the browser or driver. Can also pass the specific browser channel.

    # Get installed Chrome version
    browser-driver-manager version chrome
    
    # Get installed Chrome Beta version
    browser-driver-manager version chrome=beta
    
    # Get ChromeDriver version
    browser-driver-manager version chromedriver
  • which: Get the installed location of the browser or driver. Can also pass the specific browser channel.

    # Get installed Chrome location
    browser-driver-manager which chrome
    
    # Get installed Chrome Beta location
    browser-driver-manager which chrome=beta
    
    # Get ChromeDriver location
    browser-driver-manager which chromedriver

Options

  • -h,--help: Display the help information
  • -v,--version: Display the version information
  • --verbose: Output verbose logs