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

timmy.js

v1.0.0

Published

Javascript utility for logging and measuring timings in application testing.

Downloads

4

Readme

Timmy.js

A Javascript library that keeps track of time for individual pages and user journeys. Logs are stored in localstorage and can be visualised using simple pre-built functions.

“TIMMEH!!!” – An enthusiastic fan of Timmy.js

Background

We‘re strong believers that a good user experience should not be driven by the time it takes to complete a service or transaction.

However, there are some situations where efficiency is a key design driver. In these instances, it‘s important to understand the impact that design decisions have on the speed of completing a transaction or service.

This library was built to aid user research activities, tracking the timings of particular pages and user journeys.

How to use it

Include the library

<script src="timmy.js"></script>

Recording times

Adding a marker

You can add an individual marker at any time by calling the marker function:

timmy.marker("Clicked button"); // Returns the timestamp
<- 1510846581293

This will record the name of the event and the time that it was triggered. Markers act as isolated timings.

Timing a page

By default, Timmy.js will track the length of time a user spends on a particular web page.

For reference, timings begin when window.onload is triggered and end when window.beforeunload is called.

Timing a journey

To time a user journey, you must choose when the journey begins and ends. You can do this using the start and end functions:

timmy.start("addUser");

…

timmy.end("addUser"); // Returns the timestamp
<- 1510846587564

This will record when the journey started and ended, giving a total completion time. Starting the journey multiple times will reset the timer.

Reset timings

To reset all timings and logs, call the reset function:

    timmy.reset();

Output

Preformatted output

To get all data in a preformatted output, use the out function.

jimmy.out();
<- '<table>…</table>'

Out has an optional parameter event, which is the name of the event you would like to filter by. This allows the you to seperate preformatted output:

jimmy.out("addUser");
<- '<table>…</table>'

Raw log data

To get the raw log data, use the data function:

jimmy.data();
<- [{…},{…},{…}]

Similar to out, data also has the optional parameter event, which allows you to filter which data is returned by event name.

jimmy.data('/search');
<- [{…},{…}]

Examples

Outputting logs with jQuery

<html>
    <body>
        <div id="logs"></div>
    </body>

    <script>
        $('#logs').html(timmy.out());
    <script>
</html>