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

grunt-contrib-watch

Package Overview
Dependencies
Maintainers
3
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-contrib-watch

Run predefined tasks whenever watched file patterns are added, changed or deleted.

  • 0.4.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created

What is grunt-contrib-watch?

grunt-contrib-watch is a Grunt plugin that watches files and directories for changes. When changes are detected, it can run predefined tasks, making it useful for automating workflows such as compiling code, running tests, or refreshing a browser.

What are grunt-contrib-watch's main functionalities?

Watch Files for Changes

This feature allows you to watch JavaScript files for changes and run the 'jshint' task whenever a change is detected. The 'spawn' option is set to false to improve performance.

{
  "watch": {
    "scripts": {
      "files": ["**/*.js"],
      "tasks": ["jshint"],
      "options": {
        "spawn": false
      }
    }
  }
}

Live Reload

This feature enables live reloading of the browser when files change. The 'livereload' option is set to true, which will trigger a browser refresh whenever a watched file changes.

{
  "watch": {
    "options": {
      "livereload": true
    },
    "scripts": {
      "files": ["**/*.js"],
      "tasks": ["jshint"]
    }
  }
}

Custom Event Handling

This feature allows you to specify custom events to watch for, such as 'added' or 'deleted'. In this example, the 'jshint' task will run only when JavaScript files are added or deleted.

{
  "watch": {
    "scripts": {
      "files": ["**/*.js"],
      "tasks": ["jshint"],
      "options": {
        "event": ["added", "deleted"]
      }
    }
  }
}

Other packages similar to grunt-contrib-watch

Keywords

FAQs

Package last updated on 09 May 2013

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