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

no6-app-watcher

v1.0.13

Published

Watch and execute command

Downloads

16

Readme

watcher

Watch and execute command

Installation

npm install no6-app-watcher -g

How to use

watcher ./watch.js

watch.js is configuration file

How to use in Docker

  1. Docker

    docker run -d --name watcher -v ./test/watch.js:/usr/src/app/watch.js -v ./test:/watcher:ro doanthuanthanh88/watcher
  2. docker-compose.yaml

    watcher:
      image: doanthuanthanh88/watcher
      container_name: watcher
      tty: true
      volumes:
        - ./test/watch.js:/usr/src/app/watch.js # Overide default configuration file
        - ./test:/watcher:ro                    # Overide default folder watcher

How to run

watcher ./watch.js

watch.js: This is configuration file and it's stored at $CWD

Configuration

The below configuration file is watch.js. You can rename it to anything and pass it into execute command

module.exports = {
  node_modules: ['axios'], # External libraries which will be installed to use in exec.handle
  interval: 500,  # Interval time to watch the changes
  dir: [          # Directories to watch
    './test'
  ],
  ext: [          # File extension to watch
    /\.evt/,
    /\.txt/
  ],
  exec: [         # Map file to execute something
    {
      name: 'all-of-service', # Which is received when user post rest API to execute command remote
      file: /nginx\.evt/,     # When file match this then executing
      cmd: "echo \'thanh\'",  # Execute command here
      delay: 1000,            # Time to delay before executing. If in this period time, if user changes this file many time, it will only execute a last
      onInput: [              # Auto update file at path to make executing
        'path_file_change', 
        'file content'
      ]
      onUpdate: {               # Handke output
        console: true,          # Output to console screen
        async http(msg) {       # Output to rest API. We can use external libs in this. Input is message log
          await require('axios')({
            method: 'POST',
            url: 'https://onapis.com/SEND TO SOMETHING/ID_HERE?group=Test',
            headers: {
              'content-type': 'text/plain'
            },
            data: msg
          })
        }
      },
      onRemove(){}        # Handle when force close or the file is removed
    },
    {
      file: /c\.txt/,
      cmd: 'ping -n 5 127.0.0.1',
      delay: 0,
      handle: {
        console: true
      }
    },
    {
      file: /d\.txt/,
      cmd: 'ping -n 5 127.0.0.1',
      delay: 0,
      handle: {
        console: true
      }
    }
  ]
}