Socket
Socket
Sign inDemoInstall

expatr

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expatr

An essential tool to react on file system events


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

expatr - 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 expatr utility via npm/yarn:
$ yarn global add expatr
# -or-
$ npm i -g expatr

Usage (example)

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

The 'expatr' 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 'expatr'.

License

MIT License - see the LICENSE for more details.

Keywords

FAQs

Package last updated on 30 Jun 2020

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