Never-ending Pumpkin Mulch

    @olegjs/on-change

    1.0.13 • Public • Published

    on-change

    Build Status Coverage Status dependencies Status devDependencies Status GitHub last commit

    CLI tool to run a command if file has changed since the last time that command was run.

    Forgetting to run npm i every time after git pull and getting Error: Cannot find module...? Add the following to package.json to automate this chore.

    {
      "scripts": {
        "prestart": "on-change --file package-lock.json npm ci"
      }
    }

    This CLI tool stores a file checksum in a hidden sha file every time it run a given command. Made to automate running npm ci after pulling modified package-lock.json.

    Install

    npm install --save-dev @olegjs/on-change

    Usage

    npx @olegjs/on-change --help
    # Usage: on-file-change --file [file] [command]
    #
    # Options:
    #   --help      Show help                                                [boolean]
    #   --version   Show version number                                      [boolean]
    #   --file, -f  Path to file to check for changes              [string] [required]
    #
    # Examples:
    #   on-file-change --file package-lock.json   Reinstall dependencies on changed
    #   npm ci                                    package-lock.json

    Install

    npm i @olegjs/on-change@1.0.13

    Version

    1.0.13

    License

    ISC

    Unpacked Size

    5.96 kB

    Total Files

    6

    Last publish

    Collaborators

    • olegjs