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 🙏

© 2026 – Pkg Stats / Ryan Hefner

poll-pull-reinstall-restart

v1.1.1

Published

Readme

poll-pull-reinstall-restart

A daemon that watches a git remote and, on each poll: pulls, reinstalls dependencies if the working tree changed, and restarts a sequence of package.json scripts.

Useful for running a project on a server where deployments happen by pushing to a git branch.

Requirements

  • Node.js >= 22
  • git on PATH
  • ssh-keygen on PATH (only if generating a new SSH deploy key)
  • nvm (only if using NVM_AUTO_INSTALL or relying on .nvmrc)

Usage

1. Create a config (--init)

Run once in a project directory to write a .pprrc file:

npx poll-pull-reinstall-restart --init

Add --interactive (or -i) to be prompted for each setting:

npx poll-pull-reinstall-restart --init -i

To clone a repository first, pass the URL:

npx poll-pull-reinstall-restart --init [email protected]:user/repo.git

.pprrc is a dotenv file. Commit it or keep it local — it has no secrets unless you set SSH_KEY_PATH.

2. Run the daemon

Once a .pprrc exists (or the required environment variables are set), start the daemon:

npx poll-pull-reinstall-restart

On startup it optionally runs nvm install (if NVM_AUTO_INSTALL=true and .nvmrc is present), optionally runs corepack enable, installs dependencies, runs any ONCE_SCRIPTS to completion, then enters the poll loop. On each poll it runs git pull; if the working tree changed it re-runs nvm/corepack, reinstalls, and restarts RESTART_SCRIPTS.

If NTFY_TOPIC is set, lifecycle events (service started, update detected, restart failures, git pull failures, and shutdown) are pushed as ntfy notifications to that topic.

Configuration

Reads from .pprrc in the project root (dotenv format), falling back to environment variables.

| Variable | Required | Default | Description | | ------------------ | -------- | ----------------- | --------------------------------------------------------------------------------- | | RESTART_SCRIPTS | yes | — | Comma-separated package.json script names to run on each (re)start | | ONCE_SCRIPTS | no | — | Comma-separated scripts to run once on startup | | POLL_INTERVAL | no | 60 | Seconds between polls | | SSH_KEY_PATH | no | — | Path to SSH private key for git authentication | | INSTALL_DEV_PKGS | no | false | Install devDependencies on each reinstall | | NVM_AUTO_INSTALL | no | true | Run nvm install on startup and on each changed pull (requires .nvmrc and nvm) | | COREPACK_ENABLE | no | true | Run corepack enable after each Node version switch | | SERVICE_NAME | no | — | Label prepended to ntfy notification titles, e.g. [my-app] Service started | | NTFY_TOPIC | no | — | ntfy topic to send lifecycle notifications to | | NTFY_SERVER | no | https://ntfy.sh | ntfy server base URL |

CLI flags

--init             Write a .pprrc file and exit
--interactive, -i  Prompt for settings interactively
--verbose, -v      Increase log output