by macbre

Headless Chromium-based web performance metrics collector and monitoring tool

2.1K Stars 153 Forks Last release: over 2 years ago (v1.20.1) BSD 2-Clause "Simplified" License 2.1K Commits 46 Releases

Available items

Bug Fix

Developer services

Bug Fix

Fast resolution

Contact me before purchase

1 Support Hour

Developer services

Email/Slack Support

Ask me anything

Coding not included

phantomas npm Inline docs code style: prettier

Headless Chromium-based modular web performance metrics collector. And why phantomas? Well, because :)



latest next

npm install [email protected]

This will install a recent version of Chromium supported by




You can get support for phantomas via xs:code.

Usage example

const phantomas = require('phantomas'),
    promise = phantomas('');

promise. then(results => { console.log('Metrics', results.getMetrics()); console.log('Offenders', results.getAllOffenders()); }). catch(res => { console.error(res); });

// events handling promise.on('recv', response => { console.log('Response: %s %s [%s]', response.method, response.url, response.contentType); });

// including the custom one emitted by phantomas modules promise.on('domQuery', (type, query) => { console.log('DOM query by %s - "%s"', type, query); });

Or run


Development version

To get the latest development version of phantomas (and install all required dependencies):

git clone [email protected]:macbre/phantomas.git
npm install

Running tests

First you need to start a local nginx container that will serve static assets used by integration tests suite. Then simply run

npm t
npm t

All pull requests that are filed for this repository will have tests run via GitHub Actions.

Having problems?

Please refer to /


  • modular approach - each metric is generated by a separate "module"
  • phantomas "core" acts as an events emitter that each module can hook into
  • in-depth metrics such as: number of events bound via jQuery, calls to
    or complex and duplicated CSS selectors (via analyze-css)
  • JSON and CSV as available output formats for easy integration with automated reporting / monitoring tools
  • easy integration with Continuous Integration tools via TAP format and assertions handling
  • metrics can be sent via StatsD or stored in elasticsearch
  • easy integration with other nodejs projects via CommonJS module (see API docs)
  • metrics can be emitted from JavaScript code of the page phantomas is run against (thanks to helper functions available in window.__phantomas)
  • device profiles allow phantomas to emulate mobile or tablet (by setting a proper user agent and viewport)


All the contributors


phantomas comes as a CommonJS module (see API docs) that you can use in your nodejs projects.

You can also use it as a command line tool. Run

phantomas -h
for more details.


Please refer to

file for a full, up-to-date list of all available modules and metrics that phantomas emits.

For developers

Let's make Web a bit faster!



Introductions to phantomas and use cases:



Use grunt to automate daily dev tasks, including your's application web performance, via these great tools:

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.