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

opti-node-watch

v0.2.1

Published

minimal file watch and restart with opti-node

Readme

opti-node-watch

Run opti-node in development with automatic restart.

The idea is to minimize how much system resources node uses and provide a lighter alternative to nodemon.

CLI Usage

Simply opti-node-watch -w dist -d 500 --script dist/index.js

All flags

opti-node-watch

Watch these directories or files. (required, no default)
-w dist/client
--watch dist/server
-w dist/shared
-w dist/index.js
--watch package.json

---

Extensions: (optional, default: js,jsx,json)
--ext js,jsx,ts,tsx,json

Use of --ext is comma-separated without spaces.

---

Reload delay in milliseconds: (optional)
-d 1000
--delay 1000

---

Command to execute: (optional, default: opti-node)
--exec node
--exec python

---

Which script to run: (required, no default)
--script dist/index.js

---

Debug, show which events happen:
--debug

---

Help:
--help

Programmatic usage in JS

const path = require('path')
const { createWatcher } = require("opti-node-watch")
const distPath = path.join(__dirname, "dist")
const indexPath = path.join(distPath, "index.js")

const watcher = createWatcher({
  watchPatterns: [distPath],
  script: indexPath
});

watcher.addListener("error", err => {
  console.log("opti-node-watch error", err)
});

watcher.addListener("change", evt => {
  const { path, evtType, filename } = evt
  console.log("opti-node-watch change")
  console.log('path', path)
  console.log('evtType', evtType)
  console.log('filename', filename)
});

// pipe to the process
watcher.stdout.pipe(process.stdout);
watcher.stderr.pipe(process.stderr);

watcher.addListener("started", () => console.log("opti-node-watch started"));

watcher.start();

createWatcher(options)

options:

  • watchPatterns, string[], required, no default
  • restartDelay, number, optional, default 0
  • extensions, string[], optional, default ["js", "jsx", "json"]
  • exec, string, a command to execute
  • script, string, the node script

Development

# create dev build
npm run dev

# create production build
npm run prd

Please run npm run prd before commit! Thanks

Differences from nodemon

I'm sure this has been done a million times now. There were certain aspects of nodemon which were inconvenient to my development process or it simply wouldn't work. I also wanted to see if I can run this with opti-node.

  • Does not use chokidar
  • No json file config e.g. nodemon.json
  • No -e flag for extensions
  • No ignore yet
  • Less options for polling types
  • No triggering other events
  • Less ecosystem around it

Copying, license, and contributing

Copyright (C) Tony Crowe [email protected] (https://tcrowe.github.io) 2018

Thank you for using and contributing to make opti-node-watch better.

⚠️ Please run npm run prd before submitting a patch.

⚖️ opti-node-watch is Free Software protected by the GPL 3.0 license. See ./COPYING for more information. (free as in freedom)