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

grunt-regarde

Package Overview
Dependencies
Maintainers
4
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-regarde

Observe a set of files for changes

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
129
increased by86.96%
Maintainers
4
Weekly downloads
 
Created
Source

grunt-regarde Build Status

Observe files for changes and run tasks

Requires grunt 0.4

Getting Started

If you haven't used grunt before, be sure to check out the Getting Started guide, as it explains how to create a gruntfile as well as install and use grunt plugins. Once you're familiar with that process, install this plugin with this command:

npm install grunt-regarde --save-dev

The regarde task

Overview

Add a regarde section in your Gruntfile.js to list the files to observe as well as the task to fire when one of these files change.

Settings

files

Type: String|Array

This lists patterns describing files to observe.

tasks

Type: String|Array

Defines the tasks to run when an observed file change. Note that this is optional (in case it is missing, an implicit events: true will be inserted in the configuration) Tasks called (if they are not spawned), can access to the list of changed file through the array grunt.regarde.changed.

spawn

Type: boolean Default: false

Whether or not the tasks will be launched in a spawned subprocess. Note that in this case, the spawned task has no information on which file changed.

Events

grunt-regarde will emit an event each time a file is changed, added or deleted. The following events will be emitted:

  • regarde:file:changed, regarde:file:added, regarde:file:deleted with name of the section config, file path, tasks and whether or not the tasks will be spawn, as parameters.

  • regarde:file with status (changed, added, deleted), name of the section config, file path, tasks and whether or not the tasks will be spawn, as parameters.

  • regarde:<name>:file, where <name> is the name of the task target (i.e. css or js in the below example), with status (changed, added, deleted), file path, tasks and whether or not the tasks will be spawned, as parameters.

  • regarde:<name>:file:changed, regarde:<name>:file:added, regarde:<name>:file:deleted where <name> is the name of the task target (i.e. css or js in the below example), with status (changed, added, deleted), file path, tasks and whether or not the tasks will be spawn, as parameters.

Examples

grunt.initConfig({
  regarde: {
    js: {
      files: '**/*.js',
      tasks: ['jshint'],
      spawn: true
    },
    css: {
      files: '**/*.scss',
      events: true
    }
  }
});

License

BSD license and copyright Google

Keywords

FAQs

Package last updated on 06 Apr 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