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

fps-component

v0.0.2

Published

fps counter

Downloads

3

Readme

stats.js

JavaScript Performance Monitor

This class provides a simple info box that will help you monitor your code performance.

  • FPS Frames rendered in the last second. The higher the number the better.
  • MS Milliseconds needed to render a frame. The lower the number the better.

Screenshots

stats_js_fps.png stats_js_ms.png

Usage

var stats = new Stats();
stats.setMode(1); // 0: fps, 1: ms

// Align top-left
stats.domElement.style.position = 'absolute';
stats.domElement.style.left = '0px';
stats.domElement.style.top = '0px';

document.body.appendChild( stats.domElement );

setInterval( function () {

	stats.begin();

	// your code goes here

	stats.end();

}, 1000 / 60 );

Bookmarklet

Albeit theorically not as accurate the widget can also be easily inserted to any site using a bookmarklet. Follow the instructions.

Change Log

2012 09 01 - r11 (2,243 KB, gzip: 903 B)

  • Renamed build/Stats.js to build/stats.min.js.

2012 05 10 - r10 (2,243 KB, gzip: 903 B)

  • Changed .getDomElement() to .domElement back.
  • Removed .getFps(), .getFpsMin(), .getFpsMax(), .getMs(), .getMsMin(), .getMsMax().
  • Added .begin() and .end().
  • Added .setMode().
  • Themeable with CSS.

2012 01 18 - r9 (2,872 KB, gzip: 1,038 KB)

  • Changed .domElement to .getDomElement()
  • Added .getFps(), .getFpsMin(), .getFpsMax(), .getMs(), .getMsMin(), .getMsMax().

2011 10 16 - r8 (2.670 KB, gzip: 987 B)

  • Performance and size optimizations.
  • Removed memory mode.

2011 10 13 - r7 (4.083 KB, gzip: 1.377 KB)

  • Replaced new Date().getTime() with Date.now().

2011 05 28 - r6 (4.103 KB, gzip: 1.384 KB)

  • Updated check for memory accesible browsers.
  • Renamed MEM to MB for consistency reasons.

2010 09 21 - r5 (3.800 KB)

  • Different color per mode.
  • Added MEM mode. (Webkit-based browsers only)
  • Force text left aligned.

2010 06 11 - r4 (2.235 KB)

  • Added MS mode.

2010 05 12 - r3 (1.241 KB)

  • Switched to module pattern code style.
  • Removed position = 'absolute'.

2010 03 01 - r2 (2.177 KB)

  • Simplified.

2010 02 21 - r1

  • Accurate FPS calculation. (thx @spite!)

2009 08 09 - r0

  • Base code.