# launchpad

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

Latest version **0.8.1** (published 2023-01-25) · 0 weekly downloads

## Install

```sh
npm install launchpad
pnpm add launchpad
yarn add launchpad
bun add launchpad
```

## Health

**Score 18/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.8.1 |
| Published | 2023-01-25 |
| First published | 2012-11-21 |
| Weekly downloads | 0 |
| TypeScript types | separate (@types/launchpad) |
| Module format | CommonJS |
| Node | >= 4 |
| Dependencies | 8 |
| Unpacked size | 59.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 48 |
| Maintainers | phillipskevin, daffl, ekryski, matthewp, bmomberger-bitovi, cherif_b |
| Keywords | browsers, launcher, chrome, ie, firefox, opera, phantomjs, browserstack |

## Links

- npm: https://www.npmjs.com/package/launchpad
- Repository: https://github.com/bitovi/launchpad
- Issues: https://github.com/bitovi/launchpad/issues
- npm.io page: https://npm.io/package/launchpad

## Dependencies (8)

- [q](https://npm.io/package/q.md) ^1.4.1
- [async](https://npm.io/package/async.md) ^2.0.1
- [debug](https://npm.io/package/debug.md) ^2.2.0
- [plist](https://npm.io/package/plist.md) ^3.0.5
- [mkdirp](https://npm.io/package/mkdirp.md) ^1.0.4
- [rimraf](https://npm.io/package/rimraf.md) ^3.0.0
- [underscore](https://npm.io/package/underscore.md) ^1.8.3
- [browserstack](https://npm.io/package/browserstack.md) ^1.2.0

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 0.8.1 (latest) — 2023-01-25
- 0.8.0 — 2022-06-06
- 0.7.5 — 2020-01-23
- 0.7.4 — 2019-12-12
- 0.7.3 — 2019-10-04
- 0.7.2 — 2019-03-20
- 0.7.1 — 2019-02-18
- 0.7.0 — 2017-05-26
- 0.6.0 — 2017-04-27
- 0.5.4 — 2016-09-14
- 0.5.3 — 2016-06-14
- 0.5.2 — 2016-06-09
- 0.5.1 — 2016-01-26
- 0.5.0 — 2015-11-19
- 0.4.9 — 2015-10-16
- … 13 more at https://npm.io/package/launchpad/versions

## README

# Launchpad

[![Greenkeeper badge](https://badges.greenkeeper.io/bitovi/launchpad.svg)](https://greenkeeper.io/)
[![Build Status](https://travis-ci.org/bitovi/launchpad.svg)](https://travis-ci.org/bitovi/launchpad)

You can launch browsers! With NodeJS!

* __Local browsers__ for MacOS, Windows and Linux (like) operating systems
* __[BrowserStack](http://browserstack.com)__ browsers using the BrowserStack API

## API

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

```js
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.

```js
// 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](lib/local/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:

```js
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](https://github.com/scottgonzalez/node-browserstack)
module do all the work (API calls) for us.

<!-- space -->

---
_Source: https://npm.io/package/launchpad · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
