wesbos
wesbos5mo ago

concurrent deno tasks

I've got two servers I need to run as part of my app when in development - a vite server and an express server. Is it possible to run two tasks concurrently? I've used a package "concurrently" in the past, many others use npm-run-all. Currently using turborepo to run everything, but i've not yet dove into deno + monorepo support just yet so Im not worried about that
4 Replies
bartlomieju
bartlomieju5mo ago
Hey @wesbos, there you go:
// a.js
setInterval(() => console.log("Hello from deno task a"), 500);
// a.js
setInterval(() => console.log("Hello from deno task a"), 500);
// b.js
setInterval(() => console.log("Hello from deno task b"), 1000);
// b.js
setInterval(() => console.log("Hello from deno task b"), 1000);
{
"tasks": {
"a": "deno a.js",
"b": "deno b.js",
"concurrent": "deno task a & deno task b"
}
}
{
"tasks": {
"a": "deno a.js",
"b": "deno b.js",
"concurrent": "deno task a & deno task b"
}
}
bartlomieju
bartlomieju5mo ago
wesbos
wesbosOP5mo ago
thanks - I tried that but my terminal put one into a background process - I guess I should just stick it in a task Ill give that a shot - thanks
bartlomieju
bartlomieju5mo ago
Sure thing, let me know if you run into any problems

Did you find this page helpful?