Socket
Socket
Sign inDemoInstall

rerun-script

Package Overview
Dependencies
24
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rerun-script

Invoke npm scripts upon file changes. Configure via package.json using glob patterns.


Version published
Weekly downloads
257
decreased by-3.75%
Maintainers
1
Install size
2.16 MB
Created
Weekly downloads
 

Readme

Source

rerun-script

Build Status NPM version NPM downloads LICENSE js-standard-style

Invoke npm scripts upon file changes. Configure via package.json using glob patterns.

$ npm install rerun-script --save-dev

usage

Usage: rerun-script [options]

Options:

  -h, --help                   output usage information
  -V, --version                output the version number
  -d, --directory [directory]  package directory

configure package.json

  • NOTE 1: While the examples below use the standard lint checker, you are free to use any lint checker you like.
  • NOTE 2: The watch script in package.json is optional and is only necessary if you plan to invoke rerun-script via npm run. You can use any script name you like.

package.json

{
    "scripts": {
        "test": "node test.js",
        "lint": "standard",
        "watch": "rerun-script"
    },

    "watches": {
        "test": [ "*.js", "lib/**/*.js", "test/**/*.js" ],
        "lint": [ "*.js", "lib/**/*.js", "test/**/*.js" ]
    }
}
verbose format:
{
    "scripts": {
        "test": "node test.js",
        "lint": "standard",
        "watch": "rerun-script"
    },

    "watches": [
        {
            "script": "test",
            "patterns": [ "*.js", "lib/**/*.js", "test/**/*.js" ]
        },
        {
            "script": "lint",
            "patterns": [ "*.js", "lib/**/*.js", "test/**/*.js" ]
        }
    ]
}

If you only have one pattern to match for a script, you can pass in a string instead of an array:

{
    "scripts": {
        "test": "node test.js",
        "lint": "standard",
        "watch": "rerun-script"
    },

    "watches": {
        "test": "test/**/*.js",
        "lint": "*.js"
    }
}

start the watcher

# directly
$ ./node_modules/.bin/rerun-script

# or via `npm run watch`
$ npm run watch

screenshot

License

MIT

Keywords

FAQs

Last updated on 04 Apr 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc