https://github.com/otiai10/too
Combine multiple commands' stream, keep all foreground and kill all in one Ctrl+C
https://github.com/otiai10/too
ctrl-c kill multiple-processes sigint stderr stdout
Last synced: about 2 months ago
JSON representation
Combine multiple commands' stream, keep all foreground and kill all in one Ctrl+C
- Host: GitHub
- URL: https://github.com/otiai10/too
- Owner: otiai10
- License: mit
- Created: 2019-04-16T01:00:04.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2025-04-07T03:09:38.000Z (2 months ago)
- Last Synced: 2025-04-09T02:02:02.535Z (2 months ago)
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/too
- Size: 895 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# too
[](https://github.com/otiai10/too.js/actions/workflows/node.js.yml)
[](https://codecov.io/gh/otiai10/too.js)
[](https://codeclimate.com/github/otiai10/too.js/maintainability)
[](https://badge.fury.io/js/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
```It means, you can write 2 parallel jobs in 1 npm script!!
```js
// package.json
{
"scripts": {
"start": "too --cmd 'rails s' --cmd 'webpack'"
// Start server and client HMR in parallel,
// and you can kill both by one Ctrl+C!!
},
}
```# Why?
Sometimes we do that,
```sh
% 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
```sh
% too --cmd 'rails server' --cmd 'npm start-webpack'
```Then you will get
```sh
[0] rails # Rails log here
[1] npm # NPM log here# And you can kill both by one `Ctrl+C` (SIGINT)
```# Too files
Or you can define your tasks on a yaml file
```yaml
# too.local.yaml
main:
jobs:
- run: rails server
- run: npm start-webpack
```then
```sh
% too ./too.local.yaml
```# Install
```sh
% npm install too
```# Issues
- https://github.com/otiai10/too.js/issues