Git Product home page Git Product logo

simple-file-watch's Introduction

Simple-file-watch

Install:

npm install -g simple-file-watch

Simple nodejs cli command that will watch for changes in a directory or directories, recursively or not, and execute a command on changes. The delay set by --delay will prevent any execution of the command until the delay has passed. This is useful if the command being executed alters another file in the directory being watched. Otherwise there will be an infinite loop of file changes and executions.

Usage example:

simple-file-watch --delay=2000 --extension='js' --path='.' --path='test' --command='ls -l' --recursive --silence

Flags:

--delay=2000 // delay in milliseconds before executing command on file change
--extension='js' // only execute command on files with this extension. Default is all files
--path='.' // path to watch for changes. Multiple paths are allowed. Default is current directory
--command='ls -l' // command to execute on file change  
--recursive // watch subdirectories
--silence // no output to stdout

If you run the command without any params, it will watch any file changes in current directory, and output the file changed to stdout.

Note: There is max on number of files you can watch. See:

http://stackoverflow.com/questions/16748737/grunt-watch-error-waiting-fatal-error-watch-enospc

License MIT

simple-file-watch's People

Contributors

diversen avatar diversen7 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

ma-ve

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.