https://github.com/runnerty/trigger-file-watcher
Runnerty module: Trigger File Watcher
https://github.com/runnerty/trigger-file-watcher
Last synced: 5 months ago
JSON representation
Runnerty module: Trigger File Watcher
- Host: GitHub
- URL: https://github.com/runnerty/trigger-file-watcher
- Owner: runnerty
- License: mit
- Created: 2017-09-05T08:13:55.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-10-01T06:37:09.000Z (over 1 year ago)
- Last Synced: 2025-12-21T19:52:25.705Z (6 months ago)
- Language: JavaScript
- Size: 287 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Smart Processes Management
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Dependency Status][david-badge]][david-badge-url]
# File Watcher Trigger for [Runnerty]:
It is possible to set up file system path trigger in Runnerty with the help of auto-magically configured filewatchers. Them are defined with the **condition** property and can be fired through the following actions:
- *add*: when a file is added.
- *change*: when a file is changed.
- *unlink*: when a file is deleted.
- *error*: when there is an error in the file treatment.
### Installation:
Through NPM
```bash
npm i @runnerty/trigger-file-watcher
```
You can also add modules to your project with [runnerty-cli]
```bash
npx runnerty-cli add @runnerty/trigger-file-watcher
```
This command installs the module in your project, adds example configuration in your `config.json`.
If you have installed [runnerty-cli] globally you can include the module with this command:
```bash
rty add @runnerty/trigger-file-watcher
```
### Configuration sample:
Add in [config.json]:
```json
{
"triggers": [
{
"id": "filewatcher_default",
"type": "@runnerty-trigger-file-watcher"
}
]
}
```
### Plan sample:
Add in [plan.json]:
```json
{
"triggers": [
{
"id": "filewatcher_default",
"file_name": "/path/myfile.txt",
"condition": "change"
}
]
}
```
```json
{
"triggers": [
{
"id": "filewatcher_default",
"file_name": "/path/*.jpg",
"condition": "add"
}
]
}
```
### Chain input
This trigger sends to the custom_values of the chain the name of the file watched (file_name).
You can make use of this value through the "get values" function:
```
@GV(file_name)
```
[Runnerty]: http://www.runnerty.io
[downloads-image]: https://img.shields.io/npm/dm/@runnerty/trigger-file-watcher.svg
[npm-url]: https://www.npmjs.com/package/@runnerty/trigger-file-watcher
[npm-image]: https://img.shields.io/npm/v/@runnerty/trigger-file-watcher.svg
[david-badge]: https://david-dm.org/runnerty/trigger-file-watcher.svg
[david-badge-url]: https://david-dm.org/runnerty/trigger-file-watcher
[config.json]: http://docs.runnerty.io/config/
[plan.json]: http://docs.runnerty.io/plan/
[runnerty-cli]: https://www.npmjs.com/package/runnerty-cli