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

regwatch

v1.0.0

Published

A tool for watching the npm registry

Downloads

5

Readme

regwatch(1) -- a tool for watching npm registry updates

DESCRIPTION

This program will watch the changes feed from the npm registry, formatting it in whatever format you like and printing that to stdout.

INSTALLATION

$ npm i -g regwatch

USAGE

$ regwatch [options]

Options:

  • -0, --from-zero: Get changes starting at sequence 0. This overrides --back.
  • -h, --help: Show help.
  • --new: Only output for brand-new modules.
  • --back=<num>: How far back in the feed to start (default 10).
  • --format=<format> How to display each change (default: "name"). See FORMAT below.
  • --growl: Receive a growl notification for each change. See GROWL below.
  • -c, --cmd: A shell command to run for each change, See SHELL COMMAND below.
  • -e, --eval: JavaScript to evaluate for each change. See EVAL below.
  • -E, --eval-implicit-return: Like eval, but with an implicit return before your code. See EVAL below.

GROWL

To enable growl notifications with the --growl options, make sure an appropriate Growl helper is installed for your platform.

FORMAT

By default, the output format is name, which will only output the name of the module.

The only other option for format, currently, is npmurl, which will output the url to the package on the npm website. To activate this format:

$ regwatch --format npmurl

EVAL

When invoked with --eval <script> or -e <script>, regwatch will execute the Javascript code in <script> on each change object. Change objects have the form:

{
    id: 'name-of-module',
    rev: {
        num: 12 // an integer showing # of times module has been published
        hash: 'abc123...' // a hash of the change
    }
}

Your code must explicitly return a value, which will be outputted. The this variable refers to the change object.

For example:

$ regwatch -e 'return this.id + (this.rev.num == 1 ? " NEW" : "")'

Would output something like:

old-module
new-module NEW
some-other-module
some-other-new-module NEW

If your code is a one-liner, you can also have an implicit return in front of your code. To do this, use -E or --eval-implicit-return. For example, the following would produce the same output as above:

$ regwatch -E 'this.id + (this.rev.num == 1 ? " NEW" : "")'

SHELL COMMAND

You can execute a shell command for each change that is processed. An environment variable $CHANGE_ID is provided, which is the name of the module. The $CHANGE_REV variable has the full rev number from the change.

Example:

$ regwatch --cmd 'echo hello \$CHANGE_ID \$CHANGE_REV'

Would output something like:

hello some-module 12-abc123...
hello fun-module 4-beef741...
...

LICENSE

MIT License. See LICENSE.txt