@runnerty/trigger-file-watcher

3.0.3 • Public • Published

Smart Processes Management

NPM version Downloads Dependency Status code style: prettier

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

npm i @runnerty/trigger-file-watcher

You can also add modules to your project with runnerty-cli

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:

rty add @runnerty/trigger-file-watcher

Configuration sample:

Add in config.json:

{
  "triggers": [
    {
      "id": "filewatcher_default",
      "type": "@runnerty-trigger-file-watcher"
    }
  ]
}

Plan sample:

Add in plan.json:

{
  "triggers": [
    {
      "id": "filewatcher_default",
      "file_name": "/path/myfile.txt",
      "condition": "change"
    }
  ]
}
{
  "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/trigger-file-watcher/

    Package Sidebar

    Install

    npm i @runnerty/trigger-file-watcher

    Weekly Downloads

    0

    Version

    3.0.3

    License

    MIT

    Unpacked Size

    7.68 kB

    Total Files

    10

    Last publish

    Collaborators

    • coderty