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

moniteur

v0.8.2

Published

Monitor your asset size over time, in your browser, or using the provided HTTP API.

Downloads

53

Readme

moniteur Build Status npm version Greenkeeper badge Standard Version

For people who care about keeping an eye on their CSS and JavaScript file sizes.

Deploy

Demo & Documentation


CLI

Moniteur is also available as a command line interface:

npm install -g moniteur

Usage:

Usage: moniteur [options] [command]


Commands:

  record   record a snapshot of all asset metrics
  serve    start the server to show metrics in the browser
  assets   display the list of assets loaded by moniteur
  help     display this helpful message

Options:

  -h, --help     output usage information
  -V, --version  output the version number

Configuration: edit the .moniteurrc.yml file in the current directory.

Database configuration

For now, two types of storage are supported: Redis and local filesystem.

A Redis URL can be passed through an environment variable, instead of having it stored in the configuration file:

DB__REDIS_URL=redis://rediscloud:[email protected]:13714

Run your application like this:

DB__REDIS_URL=redis://url moniteur [options]

Note that REDIS_URL and REDISCLOUD_URL are also valid environment variables.

Development

Clone the repository and run:

npm run dev

Asset monitor API

Record data

Takes a snapshot of asset metrics and stores them in the .moniteur/ directory.

moniteur record

HTTP API

View a JSON representation of all loaded assets

/assets.json

JSON data object for HighCharts (providing the asset name's hash)

Since forever: /metrics/stylesheets/adf6e9c154cb57a818f7fb407085bff6

Between two dates: /metrics/stylesheets/adf6e9c154cb57a818f7fb407085bff6/1015711104475..1415711104475

License

MIT

Acknowledgments

Merci to https://github.com/t32k/stylestats, which has been a great source of inspiration.

And thanks to @oncletom for helping building the early versions of moniteur.

Roadmap

  • [x] Make moniteur a working node module
  • [x] Run as some sort of daemon that monitors asset metrics every X seconds
  • [x] Monitor JavaScript files
  • [ ] Unit / Integration tests
  • [ ] Option to filter graphs by time range (last 7 days, last 30 days, last year)
  • [ ] Slack Bot

Ideas

  • [ ] Providing a page's URL, scrape all assets out of it and analyse them
  • [ ] Parse all assets in a particular directory
  • [ ] Asset size budget limits
  • [ ] Email alert when budget is almost reached or exceeded
  • [ ] Weekly email recaps