New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

debounce-cmd

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

debounce-cmd

Run and cache a command based on various factors

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

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

# Using npm
npm add --save-dev cache-cmd
# Using pnpm
pnpm add --save-dev cache-cmd
# Using yarn
yarn add --dev cache-cmd

Usage

# Shows help
npm exec -- cache-cmd --help

# Runs command if it was not run in the last 20s
npm exec -- cache-cmd "echo ran this command" --time 20s

# Runs command if package-lock.json in current directory changed since last run
npm exec -- cache-cmd "npm install" --file package-lock.json

# Additionally uses custom cache directory instead of default in node_modules
npm exec -- cache-cmd "npm install" --file package-lock.json --cache-dir .config/cache

# Runs command if it was not run in a month or any of the files changed
npm exec -- cache-cmd "npm install" --time 1mo --file package-lock.json --file package.json

# Shows path to cache directory
npm exec -- cache-cmd cache dir

# Clear cache
npm exec -- cache-cmd cache clear

# You can also run it with npx to skip the install step
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!

Keywords

FAQs

Package last updated on 12 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc