1.0.0 • Published 3 years ago

exat v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

exat - an essential tool to react on file system events

Dependency Status NPM version Downloads The MIT License

It's a tiny utility which just listen to file system events(like add/update/remove) and run some command once the such event is triggered.

Installation

  1. Install the exat utility via npm/yarn:
$ yarn global add exat
# -or-
$ npm i -g exat

Usage (example)

  1. Run the exat in any empty directory:
$ exat --filter=newfile.txt rm newfile.txt
  1. Trigger file system change in another terminal:
$ touch newfile.txt
  1. Make sure that the 'rm filename' command was executed:
$ cat newfile.txt
cat: can't open 'newfile.txt': No such file or directory

The 'exat' supports the next options:

-t --timeout - when the timeout is reached, shutdown without the command execution

-p --poll - use operating system(nix/macos) facilities to be notified about file system events

-i --ignore - use simple pattern to ignore some paths

-f --filter - use regex to filter paths which could cause command execution

The rest arguments will be assumed as the command and its arguments. All stdin/stdout/stderr streams is piped from/to the child process. The child process exit code will be forwarded as an exit code of the 'exat'.

License

MIT License - see the LICENSE for more details.

1.0.0

3 years ago

0.1.0

4 years ago