Run one command interactively in the foreground, while other commands run in the background.
Use cases:
- Running linting and typechecking while writing commit messages, instead of after or before like with git hooks
- Probably others, but commits is the reason I wrote this for
yarn add run-behind --dev
# or
npm install run-behind --save-devyarn run-behind <foreground-command> <background-command-1> <background-command-2> ... <background-command-n>Install globally:
npm install -g run-behindAdd an alias to ~/.zshrc or equivalent for easy usage
alias gc=run-behind git-cz 'yarn lint --quiet' 'yarn typecheck --pretty'If you want to get back to your terminal without waiting for the tasks to end, just hit ctrl-c.
Things will be commmited even if the background command fail. It's not a bug, it's a feature. You can use git commit --amend if it turns out something failed.
Setting up caching for the commands will make the experience a lot better:
eslint: just add--cacheto the commandtsc: use--incrementaljest: usually caching is set up by default, you can add--onlyChangedto only run relevant tests
