@lusc/cli-interval

Run a command at a given interval, and aggregate its output

Usage no npm install needed!

<script type="module">
  import luscCliInterval from 'https://cdn.skypack.dev/@lusc/cli-interval';
</script>

README

interval

Repeat a command at a given interval, and aggregate its output.

NPM License Dependencies

npm install -g @lusc/cli-interval

The following example outputs "Hello" to stdout every second.

interval -t 1s "echo Hello"

It aggregates both stdout and stderr over time, and pipes them into its respective outputs.

It waits for the command to finish, waits the specified delay and runs the command again.

Arguments

  • --help print the command usage
  • -t specify the interval at which to run the command, e.g.
    • -t 100 every 100 milliseconds
    • -t 5s every 5 seconds
    • -t 2m every 2 minutes
    • -t 1h every hour
    • -t accepts any value that ms accepts.

This is a fork of Tabcorp/cli-interval.