npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

chrome-timeline

v0.0.15

Published

Write performance tests and get timeline profiling data from puppeteer.

Downloads

36

Readme

chrome-timeline

Write performance tests and get the timeline profiling data from puppeteer (chromium).

Example:

const timeline = require('chrome-timeline').timeline;

timeline(async (runner) => {
  // load something in chromium
  await runner.page.goto('https://example.com');
  // start a timeline profiling
  await runner.tracingStart('TRACE_ABC');
  // do something in the remote page
  await runner.remote((done, window) => {
    // this is within remote browser context
    some_heavy_stuff_to_be_measured();
    // call done when finished (sync variant)
    done();
    // or async example with setTimeout
    setTimeout(done, 10000);
  });
  // stop the profiling
  await runner.tracingStop();
});

By default timeline does a clean startup of a remote puppeteer chromium client, runs the provided callback and exists the client afterwards. This behavior can be changed by providing custom options (e.g. connecting to a running remote instance). timeline returns a promise containing summaries of tracings that were done denoted by the name ('TRACE_ABC' in the example).

Tracing start default options

tracingStartOptions: {
  // path to trace file export (default: no file written)
  path: null,
  // whether the trace should contain screenshots
  screenshots: true,
  // profiling categories chrome understands
  categories: [
    '-*',
    'v8.execute',
    'blink.user_timing',
    'latencyInfo',
    'devtools.timeline',
    'disabled-by-default-devtools.timeline',
    'disabled-by-default-devtools.timeline.frame',
    'toplevel',
    'blink.console',
    'disabled-by-default-devtools.timeline.stack',
    'disabled-by-default-devtools.screenshot',
    'disabled-by-default-v8.cpu_profile',
    'disabled-by-default-v8.cpu_profiler',
    'disabled-by-default-v8.cpu_profiler.hires'
  ]
}

Tracing end default options

tracingEndOptions: {
  // save trace under timeline/<epoch>/runnerId_<epoch>.trace
  saveTrace: false,
  // create a summary of trace data, also saved if saveTrace=true
  createSummary: true,
  // report uncommitted changes for current git branch in summary
  reportUncommittedChanges: false,
}

Summary

Summaries are returned by timeline for a single tracing, if tracingEndOptions.createSummary=true. They contain various useful stats from a trace for further postprocessing:

export interface ISummary extends IPostProcess {
  // path to trace flie the summary belongs to (empty if tracingEndOptions.saveTrace=false)
  traceFile: string;
  // name of the trace as given to .tracingStart(name)
  traceName: string;
  // additional git repo stats (contains {isRepo: false} for non git repo projects)
  repo: IRepoInfo;
  // puppeteer profiling metadata (e.g. hardware setup, env data, cmdline)
  metadata: {[key: string]: any};
  // profiling summary as shown in the pie chart in devtools
  summary: {[key: string]: number};
  // top down tree events
  topDown: IEvent[];
  // bottom up tree events
  bottomUp: IEvent[];
}