A CLI tool to execute script after source file changes.
yarn global add watch-then-execute
watch-then-execute "src/*.ts" --script "npm run build"
key | description |
---|---|
-e,--exclude | exclude files, repeatable |
--script | executed script |
-h,--help | Print this message. |
-v,--version | Print the version |
import { watch } from "watch-then-execute";
watch(["src/*.ts"], [], "npm run build");
watch(["src/*.ts"], ["src/*.d.ts"], "npm run build");
watch-then-execute "src/*.ts" --exclude "src/*.d.ts" --script "npm run build"