Replies: 3 comments 4 replies
-
You can create a "wrapper" task that will spawn other tasks in parallel, like so: {
"tasks": {
"foo": "echo 1",
"bar": "echo 2",
"parallel": "deno task foo & deno task bar"
}
}
|
Beta Was this translation helpful? Give feedback.
-
A common thing I do with node is add npm-run-all to dev-deps, so I can do this: {
"scripts": {
"start:frontend": "node frontend.js",
"start:backend": "node backend.js",
"start": "run-p start:frontend start:backend"
}
} If you Ctrl-C, it kills both of them, and There is a bit about a single I was looking into this to combine a webview wrapper with a an ultra backend (including live-reloading) and it seems to work great: {
"tasks": {
"dev:frontend": "deno run -A --no-check --watch ./server.jsx",
"dev:wrapper": "deno run -Ar --unstable deckagog.js",
"dev": "deno task dev:frontend & deno task dev:wrapper"
}
} Ctrl-C kills them both, closing the web window leaves the server running (which can be Ctrl-C'd.) I love that this is built-in! |
Beta Was this translation helpful? Give feedback.
-
So, it sounds like the original suggestion results in 2 processes, only one of which is killed with Ctrl-C. That makes it less than useful. I've used npm-run-all in NodeJS and would like to see something similar in Deno, though I suppose I could use the npm version of npm-run-all in Deno (but I'm on Windows, so maybe that would not work?). Does anyone know of a library in jsr that does this? |
Beta Was this translation helpful? Give feedback.
-
Is there anyway to run multiple tasks in parallel like is possible with concurrency in node?
Beta Was this translation helpful? Give feedback.
All reactions