Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

debounce-cmd

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

debounce-cmd

Debounce a command based on various factors

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
142
decreased by-16.47%
Maintainers
1
Weekly downloads
 
Created
Source

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

# Shows help
yarn debounce-cmd --help

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

# Runs comand if yarn.lock in current directory changed since last run
yarn debounce-cmd "yarn install" --file yarn.lock

# Additionally uses custom cache directory instead of default in node_modules
yarn debounce-cmd "yarn install" --file yarn.lock --cache-dir .config/cache

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

# Shows path to cache directory
yarn debounce-cmd cache dir

# Clear cache
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!

Keywords

FAQs

Package last updated on 03 Dec 2021

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