<commit_before>[![build status](https://secure.travis-ci.org/kesla/node-headless.png)](http://travis-ci.org/kesla/node-headless)
node-headless
=========

node-headless makes it easy to start and use Xvfb in node.
headless is inspired by xvfb-run - it searches for a free X display number and starts Xvfb on that.

API
=======

````javascript
var headless = require('headless');

var options = {
	display: {width: 1024, height: 980}
};

headless(options, function(err, childProcess, servernum) {
  // childProcess is a ChildProcess, as returned from child_process.spawn()
  console.log('Xvfb running on server number', servernum);
  console.log('Xvfb pid', childProcess.pid);
  console.log('err should be null', err);
});
````

headless also support an optional number to start searching from.

````javascript
var headless = require('headless');

var options = {
	display : {width: 1024, height: 980}<commit_msg>add nodei.co to readme.md<commit_after>node-headless[![build status](https://secure.travis-ci.org/kesla/node-headless.png)](http://travis-ci.org/kesla/node-headless)
=========

node-headless makes it easy to start and use Xvfb in node.
headless is inspired by xvfb-run - it searches for a free X display number and starts Xvfb on that.

[![NPM](https://nodei.co/npm/headless.png?downloads&stars)](https://nodei.co/npm/headless/)

[![NPM](https://nodei.co/npm-dl/headless.png)](https://nodei.co/npm/headless/)

API
=======

````javascript
var headless = require('headless');

var options = {
	display: {width: 1024, height: 980}
};

headless(options, function(err, childProcess, servernum) {
  // childProcess is a ChildProcess, as returned from child_process.spawn()
  console.log('Xvfb running on server number', servernum);
  console.log('Xvfb pid', childProcess.pid);
  console.log('err should be null', err);
});
````

headless also support an optional number to start searching from.

````javascript
var headless = require('headless');

var options = {
	display : {width: 1024, height: 980}
{'fraction_non_alphanumeric': 0.1580259222333001, 'fraction_numerical': 0.013958125623130608, 'mean_word_length': 4.902941176470589, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2292848', 'n_tokens_mistral': 691, 'n_tokens_neox': 647, 'n_words': 185}