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 🙏

© 2025 – Pkg Stats / Ryan Hefner

simplywatch

v3.0.0

Published

Watches files and upon change executes a command for each file INDIVIDUALLY with file-related params

Readme

SimplyWatch

Build Status Coverage Code Climate

A command line tool that monitors files under a given glob and individually executes commands (with optional dynamic placeholders) for the changed/added files.

What makes SimplyWatch different from the few similar packages available on NPM is:

  • It is intergrated with node-sass and simplyimport in which discovered files are scanned for import declarations and if SimplyWatch detects a change in any of the imported files, the provided command will be executed for the importing file. Example: 'FileA' and 'FileB' both import 'ChildFile' - when 'ChildFile' changes the command is executed for both 'FileA' and 'FileB'. Note that the imported file doesn't have to be in the provided glob, and will be watched for changes upon discovery.
  • It executes the commands concurrently. A scenario in which this is useful is when multiple files import the same child file and once the child file changes the command is executed for all importing files.
  • It provides debouncing: if a file is changed multiple times in a very short timeframe (i.e. under 2 seconds), the command will only be executed once in that time frame. Note: The default delay is 1500ms, and can be changed by specifying a different value to [-d || -execDelay]
  • It stacks execution tasks in order: If a file change triggers the command to be executed for it and then changes again (possibly multiple times) while the first command is still executing then the next command[s] will wait until the previous one finishes before being executed.
  • It can execute a final command after a given delay once SimplyWatch finishes processing a file change/addition batch. Example: once the compile command is executed for the source files, copy them to the dist/ folder and restart the server.
  • It can trim the messages outputted from the commands to a certain # of characters. This is useful for example when commands encounter an error they output the entire file's content in order to highlight a line that triggered the error, which can sometimes result in extremely large console outputs.

Installation:

npm install simplywatch

Usage:

Command Line Usage

simplywatch -g <glob> -x <command to execute> [options]

Options:

-g, --glob          glob/dir to watch. Multiple globs can be passed: -g "globA" "globB"
-i, --ignore        glob/dir to ignore. Multiple globs can be passed: -g "globA" "globB"
-x, --execute       Command to execute upon file addition/change
-f, --finally       Command to execute *once* after all changed files have been processed. Example: if a file change triggered a command to be executed for 10 files, this "finally" command will be executed after the time specified in --finallyDelay
-d, --delay         Execution delay, i.e. how long should simplywatch wait before re-executing the command. If the watched file changes rapidly, the command will execute only once every X ms
-D, --finallyDelay  The amount of milliseconds to wait before executing the "finally" command
-t, --trim          Trims the output of the command executions to only show the first X characters of the output
-s, --silent        Suppress any output from the executing command (including errors)
-b, --background    Run SimplyWatch as a background daemon
-l, --log           Path of the target log file when running in background mode
-h                  Show help
--version           Show version number                                  

Execution Command Placeholders

"path"  -  full path and filename
"root"  -  file root
"dir"   -  path without the filename
"reldir"-  directory name of file relative to the glob provided
"base"  -  file name and extension
"ext"   -  just file extension
"name"  -  just file name

Example:

simplywatch -g "assets/**" -x "node-sass #{path} -o dist/css/#{name}.css"
simplywatch -g "assets/*.coffee" -i "dontCompile/*" -x "cat {{path}} | coffee -s -c > dist/{{name}}.js"