exec-on-changed

execute command when file changed

Usage no npm install needed!

<script type="module">
  import execOnChanged from 'https://cdn.skypack.dev/exec-on-changed';
</script>

README

node-exec-on-changed

Node.js utility: execute command when file changed

exec-on-changed -d /path/to/watching/dir -f /path/to/exec/file
Table of Contents

Requirements

  • development on Node 11.6.0

Usage

CLI

exec-on-changed -d /path/to/watching/dir -f /path/to/exec

Args

  1. watching directory path : specified with --dir (-d)
  2. path to changed file

Example

  • /path/to/exec
#!/bin/bash
echo "$@"

run exec-on-changed

$ exec-on-changed -d /path/to/watching/dir -f /path/to/exec

change any file in /path/to/watching/dir

$ touch /path/to/watching/dir/path/to/target

then, exec-on-changed process should display below.

/path/to/watching/dir path/to/target

Install

npm install --save-dev exec-on-changed

License

node-exec-on-changed is licensed under the MIT license.

Copyright © since 2018 shun@getto.systems