0.1.8 ā¢ Published 3 years ago
scrippy v0.1.8
scrippy š
Run arbitrary scripts in parallel alongside pretty output from their log files
$ npx scrippy slow_script 'node dummy_script' logging_script:logging_script.log
ā “ tests/fixtures/slow_script (7.282s)
āŗ doing something slow....
almost done...
ā node tests/fixtures/dummy_script
ā tests/fixtures/logging_script (0.203s)
All commands succeeded.
Features
- Run any number of arbitrary shell scripts in parallel via child processes
- Stream live logs from each process
- Optionally provide a separate log file to tail
Installation
You can install scrippy
globally via:
npm install -g scrippy
# or
yarn global add scrippy
or locally without including -g
or global
.
You can also run without manual installation, via npx:
npx scrippy
Usage
Provide commands as positional arguments to run them in parallel. For example:
$ scrippy 'git gc' 'echo hi'
ā git gc (0.804s)
ā echo hi
All commands succeeded.
This would run the git gc
and echo hi
commands in parallel subprocesses and stream any stdout/stderr to the console while they run.
If we have a script that logs to a known file, we can substitute the command output for that:
$ scrippy logging_script:logging_script.log --persistent-output
ā tests/fixtures/logging_script (0.201s)
āŗ Output from tests/fixtures/logging_script.log:
My log line, i = 5
My log line, i = 6
My log line, i = 7
My log line, i = 8
My log line, i = 9
All commands succeeded.
Options
$ scrippy --help
Options:
--help Show help [boolean]
--version Show version number [boolean]
--verbose Run with verbose logging [boolean] [default: false]
--log-lines Number of log lines to show at once per command
[number] [default: 5]
--color Whether to show colors in the terminal
[boolean] [default: true]
--timers Whether to show execution times for scripts
[boolean] [default: true]
--persistent-output Whether to persist output of log lines after command
success [boolean] [default: false]
Advanced
There's a js API exported which can be called from a wrapper script if desired, and aims to mimic the cli as closely as possible. Check the code to learn more (no documentation for this currently).