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

file-watchr

v1.0.0

Published

A package to watch for file changes in a directory

Readme

Monorepo Watch

NOTE: This is a work in progress. Currently it's in its beta state. Any suggestions are warmly welcomed 😄. A asynchronous, customizable file watcher for projects using lerna, yarn workspaces, and monorepos.

Recommended Usage

It is recommended to use terminals that has a at least level=2 support for colors(256 color support)

Terminals that support colors are:

  1. Gitbash
  2. Windows Terminal
  3. zsh
  4. bash

Installation

npm install --save file-watchr
npm install -g file-watchr # Optional way to add the packge globally

or

yarn add file-watchr
yarn add global file-watchr # Optional way to add the packge globally

Usage

See configuration section below on how to configure your watcher.

  1. Create a config file in the working directory. Eg:
src
├── dir1
│   ├── file1
│   └── file2
└── dir2
    ├── file1
    └── file2
watcher.config.js <--root
  1. Now write the following configuration in the config file.
module.exports = {
	root: process.cwd(),
	watchType: "Raw", // Can be "Node" or "Raw" see configuration section below for more details
}
  1. Now run the following command in the terminal.
npm run watcher -c ../../watcher.config.js -i src

or

yarn watcher -c ../../watcher.config.js -i src

The -c flag is the config file path and -i is the dirs to include. For multiple dirs use -i={"src","lib", etc...}

This will watch the src directory for any file changes.

Configuration

NOTE: Only CommonJS is supported for the config file

//watcher.config.js


/**
 * Include types for ease of use
 * @type {import('file-watchr/dist/types/types.d.ts').IConfig}
 */

module.exports = {
    /**
     * @required
     * @default process.cwd()
     * 
     * The root directory of the project
    */
    root: string,

    /**
     * @optional
     * @default ["src"]
     * 
     * Can be passed as command-line argument as well.
     * The directories to be watched inside the package folder.
     * 
     * Globbing is supported.
    */
    include: string[],

    /**
     * @required
     * @default {}
     * 
     * 
     * Options that is directly passed to the `chokidar.watch` method.
     * Please refer to the https://github.com/paulmillr/chokidar#api
     * to see all the available options
    */
    options: chokidar.WatchOptions,

    /**
     * @optional
     * @type {
            add?: (opts: ActionOpts) => Promise<void>
            addDir?: (opts: ActionOpts) => Promise<void>
            unlink?: (opts: ActionOpts) => Promise<void>
            unlinkDir?: (opts: ActionOpts) => Promise<void>
            change: (opts: ActionOpts) => Promise<void>
        } EventAction
     *
     * @type {
        filePath: string;
        stats: fs.Stats;
        } ActionOpts
     * 
     * This is the action that is to be performed when different events 
     * occur.
    */
    actions: EventAction,

    /**
     * @optional
     * @default []
     * 
     * A command that will be ran on all file event changes.
     * 
     */
    runScripts: string | string[],

    /**
     * @optional
     * @default true
     * 
     * If true, the watcher will not pipe any logs to process.stdout 
     * and set the stdio to "ignore". Only applicable for situations  
     * where `runScripts` is defined.
     * 
     */
    noChildProcessLogs: boolean,

    /**
     * @optional
     * @default true
     * 
     * If true, then all available options will be automatically be displayed.
     */
    autoShowOptions: boolean,

    /**
     * @optional
     * @default []
     * @note Only available for `Node` watchType.
     * @type {
        name: string
        folders: string[]
       } DependenciesPathType
     * 
     * A list of directories that can be added outside of the root directory. A common use case is when you have a monorepo.
     */
    dependenciesPath: DependenciesPathType[],
        
}