debounce-cmd
⚠️ This package was renamed to cache-cmd, therefore debounce-cmd is deprecated.
Run and cache a command based on
- time since last run
- file change
Install
npm add --save-dev cache-cmd
pnpm add --save-dev cache-cmd
yarn add --dev cache-cmd
Usage
npm exec -- cache-cmd --help
npm exec -- cache-cmd "echo ran this command" --time 20s
npm exec -- cache-cmd "npm install" --file package-lock.json
npm exec -- cache-cmd "npm install" --file package-lock.json --cache-dir .config/cache
npm exec -- cache-cmd "npm install" --time 1mo --file package-lock.json --file package.json
npm exec -- cache-cmd cache dir
npm exec -- cache-cmd cache clear
npx cache-cmd "echo ran this command" --time 20s
You can use it to execute commands conditionally in package.json
scripts.
{
"scripts": {
"start-dev": "cache-cmd \"npm install\" --file package-lock.json && 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!