torufurukawa / too.js

Combine multiple commands' stream, keep all foreground and kill all in one Ctrl+C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

too

The opposite of tee command, combining stdout/stderr from multiple commands and kill them with one signal (Ctrl+C).

-> command 1 stream ─┐
-> command 2 stream ─┤
                     └─ stdout/stderr/SIGINT to kill both

This is JavaScript implementation of too.

Why?

Sometimes we do that,

% nohup rails server &
% nohup npm start-webpack &

# after you did some work

% pkill rails
% pkill webpack

I don't wanna do this any more, just wanna run multiple processes and kill them with one Ctrl+C!

Usage

% too --cmd `rails server` --cmd `npm start-webpack`

Then you will get

[0] rails   # Rails log here
[1] npm     # NPM log here

# And you can kill both by one `Ctrl+C` (SIGINT)

Install

TODO: publish it to npmjs.org

% npm install git+https://git@github.com/otiai10/too.js.git

# I don't like global install :p
# npm install -g git+https://git@github.com/otiai10/too.js.git

About

Combine multiple commands' stream, keep all foreground and kill all in one Ctrl+C


Languages

Language:JavaScript 100.0%