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

npmstats

v1.2.0

Published

stats for npm

Downloads

3

Readme

npm-stats Build Status

Ever wonder how much of your life you spend on npm installs? npm-stats logs how much time you spend running npm commands.

Installation

npm install npmstats -g
echo "source $HOME/.npm-stats/npm-stats.sh" >> some_*rc

or

  • Clone this repo to your home like, $HOME/.npm-stats
  • Source this script with your profile of choice. Make sure to add it at the end
mkdir -p "$HOME/.npm-stats"
git clone https://github.com/jaxgeller/npm-stats "$HOME/.npm-stats"
echo "source $HOME/.npm-stats/npm-stats.sh" >> some_*rc

Usage

npm-stats will hook into npm automatically, all you need to do is run npm-stats whenever you want some sweet stats.

npm-stats v1.0.0

Usage:
  npm-stats             Show stats in human readable format
  npm-stats dates       Just show date data
  npm-stats timing      Just show timing data
  npm-stats graph       Show a graph of the stats
  npm-stats raw         Outputs raw data
  npm-stats help        Show this message
  npm-stats version     Show the current version installed

How it works

npm-stats is a simple bash script. When you source it into your shell, it acts as a simple pre-filter to npm. If you run any command associated with installing, it appends to a log at ~/.npm-stats/timing with the date and how long it took in seconds.

npm-stats also provides some helper functions to help understand the logging, such as graphing and parsing the log.

Note: graphing requires gnuplot

Updating

If you used npm, just run npm update npmstats -g. Otherwise, updating is simple, just cd into $HOME/.npm-stats, run git pull, and refresh the shell.

Examples

$ npm-stats

You've run npm install 8 times. For a total of 28 seconds.
$ npm-stats graph

                         npm install timing distribution


  140 +-+-------+---------+---------+--------+---------+---------+-------+-+
      +         +         +         +        +         +         +         +
  120 +-+            ******    ***********        ******    ******       +-+
      |              *    ******    *    *****    *    ******    *         |
      |              *    *    *    *    *   ******    *    *    *         |
  100 +-+            *    *    *    *    *   *    *    *    *    *       +-+
      |              *    *    *    *    *   *    *    *    *    *         |
   80 +-+       ******    *    *    *    *   *    *    *    *    *       +-+
      |         *    *    *    *    *    *   *    *    *    *    *         |
   60 +-+       *    *    *    *    *    *   *    *    *    *    *       +-+
      |         *    *    *    *    *    *   *    *    *    *    *         |
   40 +-+       *    *    *    *    *    *   *    *    *    *    *       +-+
      |         *    *    *    *    *    *   *    *    *    *    *         |
      |         *    *    *    *    *    *   *    *    *    *    ******    |
   20 +-+       *    *    *    *    *    *   *    *    *    *    *    *  +-+
      +         *    *    *    *    *    *   *    *    *    *    *    *    +
    0 +-+-------*******************************************************--+-+
     -10        0         10        20       30        40        50        60
                                     timing
$ npm-stats raw

2015-10-31 15:09:25    2
2015-10-31 15:10:26    1
2015-10-31 15:33:25    1
2015-10-31 15:33:27    2
2015-10-31 15:33:28    1
2015-10-31 15:34:31   11
2015-10-31 15:34:35    1
2015-10-31 15:35:13    9