track-coach
Simple replacement for npm run scripts
Why?
npm run TASK_NAME
is a sufficient task runner in most scenarios, but making it work cross-platform requires a combination of things like npm-run-all
or concurrently
and the use of pre-
and post-
prefixes. This can become really unwieldy if you want to start a server, run a task, then shut down a server. track-coach
makes this process easy.
Install
npm install --save-dev track-coach
Usage
// package.json
// scripts.js const coach run hide prepare delay managedRun = ; const tasks = string: "echo 'you can use a string'" { console; } { // npm start --someVar=thing console; } { // changing process.env changes variables in the shell processenvCUSTOM = 'blah'; await ; } async { await ; } async { // Note: hide only hides the secret in the track-coach logs, // not the shell output await ; } async { await ; } // managedRun allows you to start a script, then end it later { return ; } { const server = tasks; await ; console; serverchildProcess; await server; }; ;
Now you can run any of the tasks with npm start TASK_NAME
License
MIT