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 🙏

© 2024 – Pkg Stats / Ryan Hefner

devtools-timeline-model-browser

v1.0.2

Published

Browser helper for parsing DevTools Timeline traces into structured profiling data models

Downloads

1

Readme

devtools-timeline-model-browser

GitHub version npm version Dependency Status

Browser-friendly library for parsing DevTools Timeline traces into structured profiling data models. Heavily inspired by devtools-timeline-model. Should work in any modern browser.

Develop

$ git clone https://github.com/addyosmani/devtools-timeline-model-browser
$ cd devtools-timeline-model-browser
$ npm install
# or $ yarn if you have yarn installed

To build the source run webpack or npm run build.

Usage

dist contains a globals-friendly timeline-model-browser.js build that can be dropped into any page. e.g:

<script src='dist/timeline-model-browser.js'></script>

From there, you'll have access to a new global, TimelineModelBrowser that can be passed the contents of any valid trace file.

const traceFileContents = '...'; // Let's pretend you've fetched a trace file
const model = new TimelineModelBrowser(traceFileContents);

You'll now have access to the same helpers available in the devtools-timeline-model package:

// tracing model
model.tracingModel()
// timeline model, all events
model.timelineModel()
// interaction model, incl scroll, click, animations
model.interactionModel()
// frame model, incl frame durations
model.frameModel()
// filmstrip model, incl screenshots
model.filmStripModel()

// topdown tree
model.topDown()
// bottom up tree
model.bottomUp()
// bottom up tree, grouped by URL
model.bottomUpGroupBy('URL') // accepts: None Category Subdomain Domain URL EventName

Demo

A demo that uses the dist build is available in the demo directory. Fire up a local server in the repo root, then navigate to /demo/ to try it out. Instructions are included in the index.

Why

Is this useful?

The Chrome DevTools Timeline allows you to save traces by right-clicking on the Timeline waterfall. The trace format of these files can be dense, but contains detailed information useful for anyone building web performance tooling. The goal of this module is to bring the benefits of the devtools-timeline-model package to the browser so folks can easily build tools that consume and reuse this data outside of writing a DevTools extension or using Node.

This package?

devtools-timeline-model is an excellent package if you're trying to build tools targeting a Node environment that want to parse DevTools traces into an easy to reason about model. A few assumptions are built into that package, including use of Node built-ins, such as fs, resolve and so on.

I found that shimming these with browserify-fs and the brfs transforms were not sufficient to create a browser-friendly version of that package, so this is a complimentary repo that lets you easily reuse that work in the browser.

License

Apache © Addy Osmani