Skip to content

Headless is a Node.js wrapper for Xvfb, the virtual framebuffer

License

Notifications You must be signed in to change notification settings

juliangruber/node-headless

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

build status 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

var headless = require('headless');

headless(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.

var headless = require('headless');

headless(200, function(err, childProcess, servernum) {
  // servernum will be at least 200
  console.log('Xvfb running on server number', servernum);
  console.log('Xvfb pid', childProcess.pid);
});

install

With npm, do:

npm install headless

If you're having problems with Xvfb-instances not getting killed correctly, and is running on a platform that the posix-module supports, install child-killer (npm install child-killer) and headless will automatically use it.

About

Headless is a Node.js wrapper for Xvfb, the virtual framebuffer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%