# buster-server-cli

> buster-server CLI library

Latest version **0.4.0** (published 2015-11-28) · BSD-3-Clause license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install buster-server-cli
pnpm add buster-server-cli
yarn add buster-server-cli
bun add buster-server-cli
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2015-11-28 |
| First published | 2012-06-20 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 4 |
| Dependencies | 8 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | August Lilleaas and Christian Johansen |
| Maintainers | augustl, cjohansen, dominykas, dwittner |

## Links

- npm: https://www.npmjs.com/package/buster-server-cli
- Repository: https://github.com/busterjs/buster-server-cli
- Homepage: http://busterjs.org/docs/buster-server-cli
- Issues: https://github.com/busterjs/buster-server-cli/issues
- npm.io page: https://npm.io/package/buster-server-cli

## Dependencies (8)

- [ejs](https://npm.io/package/ejs.md) 2.x
- [ramp](https://npm.io/package/ramp.md) 2.x
- [platform](https://npm.io/package/platform.md) 1.x
- [buster-cli](https://npm.io/package/buster-cli.md) 0.8.x
- [finalhandler](https://npm.io/package/finalhandler.md) 0.4.x
- [serve-static](https://npm.io/package/serve-static.md) 1.x
- [phantom-proxy](https://npm.io/package/phantom-proxy.md) 0.1.x
- [ramp-resources](https://npm.io/package/ramp-resources.md) 2.x

## Recent versions

- 0.4.0 (latest) — 2015-11-28
- 0.3.4 — 2015-03-16
- 0.3.3 — 2015-03-12
- 0.3.2 — 2015-01-23
- 0.3.1 — 2014-09-17
- 0.3.0 — 2013-09-16
- 0.2.3 — 2013-09-16
- 0.2.2 — 2012-12-22
- 0.1.2 — 2012-12-22
- 0.2.1 — 2012-12-21
- 0.1.1 — 2012-12-21
- 0.2.0 — 2012-11-26
- 0.1.0 — 2012-06-20

## README

# buster-server-cli #

[![Build status](https://secure.travis-ci.org/busterjs/buster-server-cli.png?branch=master)](http://travis-ci.org/busterjs/buster-server-cli)

Command-line interface API for running [ramp](https://github.com/busterjs/ramp/)
instances with a simple interface that allows capturing and viewing a list of
connected browsers.

In Buster, this module is the implementation of the `buster server` command. It
does not define the binary however, as it is intended to be generic enough to be
reused outside of Buster.

## Possible use cases ##

The capture server is the central piece in Buster's multiple browser automation
capabilities. This module can be used as is to run tests for any framework, as
it does not know anything about tests at all. However, if you're shipping a
capture server for your own framework, you may want to brand your server a
little.

The following example shows how to create a custom capture server for the
fictional `checkit` test framework.

### The binary ###

    // checkit/bin/checkit-server
    var path = require("path");
    var serverCli = require("buster-server-cli");

    serverCli.create(process.stdout, process.stderr, {
        missionStatement: "Checkit crazy multi-browser test runner server",
        description: "checkit-server [options]",
        templateRoot: path.join(__dirname, "..", "views"),
        documentRoot: path.join(__dirname, "..", "public")
    }).run(process.argv.slice(2));

### The index template ###

You need to define two templates for the server to work correctly. The first one
is `index.ejs`, which is an [ejs](http://embeddedjs.com/) template for the
index page of the server. [Buster's index template](https://github.com/busterjs/buster-server-cli/blob/master/views/index.ejs)
renders a list of captured browsers and a link to `/capture`, which is the
URL that causes the browser to become a captured slave.

The `index.ejs` template is rendered with one piece of data — `slaves` — which
is an array of slave objects:

* `slave.browser` A string, i.e. "Firefox"
* `slave.platform` A string, i.e. "Linux"
* `slave.version` A string, i.e. "12.0"
* `slave.os` A string, contains a richer OS/platform description
* `slave.userAgent` The original user agent

### The header template ###

The second template is the `header.ejs` template. It is used in the top frame
in the frameset that is displayed in captured slaves. Currently this is just
a static template, but future versions will expose an API to communicate with
the server here to display progress etc.

See [Buster's header template](https://github.com/busterjs/buster-server-cli/blob/master/views/header.ejs)
for a reference implementation.

## Changelog

**0.4.0** (2015-Nov-28)

* Upgraded all dependencies
* Replaced `paperboy` with `serve-static` 

**0.3.4** (2015-Mar-16)

* [Additional param `sessionId` for method `captureHeadlessBrowser`.](https://github.com/busterjs/buster-server-cli/commit/dcb4d19)

**0.3.3** (2015-Mar-12)

* [Waits now until headless browser is started before calling callback of run. Needed for buster-ci.](https://github.com/busterjs/buster-server-cli/commit/6cf0b3f290)

**0.3.2** (2015-Jan-23)

* Fix for issue [#432 - buster-server says "running" even if address is already in use](https://github.com/busterjs/buster/issues/432)
* PR [`agent.name` could somehow be `null` and will cause `buster-server-cli` to exit](https://github.com/busterjs/buster-server-cli/pull/6)

**0.3.1** (2014-Sep-17)

* Fix for issue [#416 - buster-server crash with IE 11 on W7 only if there is two browsers captured](https://github.com/busterjs/buster/issues/416)

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