UNPKG

1.91 kBMarkdownView Raw
1@cypress/xvfb: easily start and stop an X Virtual Frame Buffer from your node apps.
2-----
3
4[![CircleCI](https://circleci.com/gh/cypress-io/xvfb.svg?style=svg)](https://circleci.com/gh/cypress-io/xvfb)
5[![Build Status](https://travis-ci.org/cypress-io/xvfb.svg?branch=master)](https://travis-ci.org/cypress-io/xvfb)
6[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
7
8### Usage
9
10```javascript
11var Xvfb = require('xvfb');
12var xvfb = new Xvfb();
13xvfb.start(function(err, xvfbProcess) {
14 // code that uses the virtual frame buffer here
15 xvfb.stop(function(err) {
16 // the Xvfb is stopped
17 });
18});
19```
20
21The Xvfb constructor takes four options:
22
23* <code>displayNum</code> - the X display to use, defaults to the lowest unused display number >= 99 if <code>reuse</code> is false or 99 if <code>reuse</code> is true.
24* <code>reuse</code> - whether to reuse an existing Xvfb instance if it already exists on the X display referenced by displayNum.
25* <code>timeout</code> - number of milliseconds to wait when starting Xvfb before assuming it failed to start, defaults to 500.
26* <code>silent</code> - don't pipe Xvfb stderr to the process's stderr.
27* <code>xvfb_args</code> - Extra arguments to pass to `Xvfb`.
28
29### Debugging
30
31Run with `DEBUG=xvfb` environment variable to see debug messages. If you want
32to see log messages from the Xvfb process itself, use `DEBUG=xvfb,xvfb-process`.
33
34### Thanks to
35
36Forked from [node-xvfb](https://github.com/Rob--W/node-xvfb)
37
38* [kesla](https://github.com/kesla) for https://github.com/kesla/node-headless
39* [leonid-shevtsov](https://github.com/leonid-shevtsov) for https://github.com/leonid-shevtsov/headless
40* [paulbaumgart](https://github.com/paulbaumgart) for creating the initial version of this package.
41
42both of which served as inspiration for this package.