1. watch-run
watch specific files or directories and re-execute a given command
watch-run
Package: watch-run
Created by: queckezz
Last modified: Tue, 28 Jun 2022 21:57:45 GMT
Version: 1.2.5
License: MIT
Downloads: 10,982
Repository: https://github.com/queckezz/watch-run

Install

npm install watch-run
yarn add watch-run

watch-run(1)

Note: Check out wait-run or just-wait for better and more recent approaches.

Re-execute a given command everytime something changes in a specific directory. Build upon gaze.

Installation

$ npm install -g watch-run

Usage

Via --help:

Usage: watch-run <cmd>

Options:

  -h, --help               output usage information
  -p, --pattern <pattern>  glob pattern. "," separates multiple patterns.
                           More info: https://github.com/isaacs/minimatch
  -i, --initial            run <cmd> on initial startup
  -d, --delay <n>          delay execution of <cmd> for a number of milliseconds
  -s, --stop-on-error      stop watching and exit when errors occur in <cmd>

Examples:

  # watch dir and execute cmd
  $ watch-run -p 'lib/**' cat package.json

  # watch dir "lib" and "src" and execute cmd
  $ watch-run -p 'lib/**,src/**' cat package.json

Example

$ watch-run -p 'js/modules/**/*.js' browserify main.js -o public/build.js

License

MIT

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin