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

launchpad

v0.8.1

Published

You can launch browsers! From NodeJS! Local ones! Remote ones! Browserstack ones!

Downloads

9,299

Readme

Launchpad

Greenkeeper badge Build Status

You can launch browsers! With NodeJS!

  • Local browsers for MacOS, Windows and Linux (like) operating systems
  • BrowserStack browsers using the BrowserStack API

API

The general API for any launcher (<type>) looks like this:

var launch = require('launchpad');
launch.<type>(configuration, function(error, launcher) {
  launcher.browsers(function(error, browsers) {
    // -> List of available browsers with version
  });

  launcher(url, configuration, function(error, instance) {
    instance // -> A browser instance
    instance.id // -> unique instance id
    instance.stop(callback) // -> Stop the instance
    instance.status(callback) // -> Get status information about the instance
  });

  launcher.<browsername>(url, function(error, instance) {
    // Same as above
  });
});

Local launchers

Local launchers look up all currently installed browsers (unless limited by LAUNCHPAD_BROWSERS - see below for details) and allow you to start new browser processes.

// Launch a local browser
launch.local(function(err, local) {
  local.browsers(function(error, browsers) {
    // -> List of all browsers found locally with version
  });
  
  local.firefox('http://url', function(err, instance) {
    // An instance is an event emitter
    instance.on('stop', function() {
      console.log('Terminated local firefox');
    });
  });
});

Environment variables impacting local browsers detection

By default Launchpad looks up all installed browsers. To speed-up this process you can define the following env variables:

  • LAUNCHPAD_BROWSERS - comma delimited list of browsers you want to use, e.g. LAUNCHPAD_BROWSERS=chrome,firefox,opera. Other browsers will not be detected even if they are installed.
  • LAUNCHPAD_<browser> - specifies where given browser is installed so that Launchpad does not need to look for it, e.g. LAUNCHPAD_CHROME=/usr/bin/chromium

The following browser names are recognized: chrome, firefox, safari, ie, edge, opera, canary, aurora, electron, phantom, nodeWebKit. Not all platforms support all browsers - see platform for details.

Browserstack

BrowserStack is a great cross-browser testing tool and offers API access to any account that is on a monthly plan. Launchpad allows you to start BrowserStack workers through its API like this:

launch.browserstack({
    username : 'user',
    password : 'password'
  },
  function(err, browserstack) {
    browserstack.browsers(function(error, browsers) {
      // -> List of all Browserstack browsers
    });
    
    browserstack.ie('http://url', function(err, instance) {
      // Shut the instance down after 5 seconds
      setTimeout(function() {
        instance.stop(function (err) {
          if(err) {
            console.log(err);
          }
          console.log('Browser instance has stopped');
        });
      }, 5000);
  });
});

Behind the scenes we have the node-browserstack module do all the work (API calls) for us.