timer-runner

    0.0.9 • Public • Published

    timer-runner

    Build Status npm version npm downloads

    ⏲🧝‍♂️️a simple, YAML-based configurable timer runner

    How To Use

    1. Install timer globally

      npm i timer-runner -g
    2. Create timer.yml

      name: timer
      script: timer-run
      watch: ./tasks
      env:
        LOGGER_LEVEL: debug
      error_file: ./logs/err.log
      out_file: ./logs/out.log
      merge_logs: true
      log_date_format: YYYY-MM-DD HH:mm:ss Z
    3. Create a list of timer task with yaml in task dir

      name: test
      rule:
        hour: 2
        minute: 0
        dayOfWeek: [0, 1, 2, 3, 4, 5, 6]
      api:
        url: https://abc.com/sign
        method: post
        headers:
          host: https://abc.com
          origin: https://abc.com
          content-type: application/x-www-form-urlencoded
          cookie: $secret
          x-requested-with: https://abc.com
        data:
          api_version: 1
          app_client_id: 1
    4. Start the timer with pm2

      pm2 start timer.yml

    Keywords

    none

    Install

    npm i timer-runner

    DownloadsWeekly Downloads

    0

    Version

    0.0.9

    License

    MIT

    Unpacked Size

    7.49 kB

    Total Files

    6

    Last publish

    Collaborators

    • kuitos