Assets metrics using Puppeteer
Last updated a year ago by andersonba .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install puppeteer-assets 
SYNC missed versions from official npm registry.

Puppeteer Assets npm version Build Status

Gets assets metrics using Puppeteer.

Want to know which scripts are loaded in your page? This module allows you to extract and audit the metrics.


Set up

yarn add puppeteer-assets


Using CLI

puppeteer-assets www.google.com

Using on Node.js

const assetsMetrics = require('puppeteer-assets');

const metrics = await assetsMetrics('https://www.google.com');


Exports assets metrics via HTTP for Prometheus consumption.


Use docker image:

docker run --name=prometheus-assets -d -p 3000:3000 andersonba/prometheus-assets

Now, in your Prometheus configuration (/etc/prometheus/prometheus.yml), add a new target.

You can monitor multiple URLs passing params each scrape config. See example

If you prefer use a configuration file, create a config.yml file. Then, run the container defining the volume:

docker run --name=prometheus-assets -v /tmp/config.yml:/app/prometheus/ -d -p 3000:3000 andersonba/prometheus-assets


assetsMetrics(url, options)

Execute the command

  • url - Required. Page URL.
  • options.internalPattern - String/Regex. Identify scripts as Internal based on RegExp (Default: null)
  • options.mimeTypes - Array of String/RegExp. File types to be matched (Default: 'javascript')

Current Tags

  • 0.2.0                                ...           latest (a year ago)

2 Versions

  • 0.2.0                                ...           a year ago
  • 0.1.0                                ...           a year ago
Maintainers (1)
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 3
Dependencies (6)
Dev Dependencies (3)
Dependents (0)

Copyright 2014 - 2017 © taobao.org |