debounce-cmd
Debounce a command based on
- time since last run
- file change
Install
yarn add --dev debounce-cmd
or
npm install --save-dev debounce-cmd
Usage
yarn debounce-cmd --help
yarn debounce-cmd "echo ran this command" --time 20s
yarn debounce-cmd "yarn install" --file yarn.lock
yarn debounce-cmd "yarn install" --file yarn.lock --cache-dir .config/cache
yarn debounce-cmd "yarn install" --time 1mo --file yarn.lock --file package.json
yarn debounce-cmd cache dir
yarn debounce-cmd cache clear
You can use it to execute commands conditionally in package.json
scripts.
{
"scripts": {
"dev": "debounce-cmd \"yarn\" --file yarn.lock && start-dev-server"
}
}
Contribute
If you find a bug or something you don't like, please submit an issue or a pull request. I'm happy about any kind of feedback!