Deno now includes a Task Runner starting from version 1.20 (released on Mar 17, 2022).
To set up commands, you can specify them in the project's Deno configuration file under the "tasks"
key. For instance:
{
"tasks": {
"data": "deno task collect && deno task analyze",
"collect": "deno run --allow-read=. --allow-write=. scripts/collect.js",
"analyze": "deno run --allow-read=. scripts/analyze.js"
}
}
The tasks can be viewed with deno task
and executed using
deno task task-name [additional-args]...
. For example, to run the
data
task, you would use
deno task data
.
For further details on the Task Runner, refer to the official documentation. This link directs to the most recent version's docs.
However, according to the v1.26.1 documentation (the latest version as of October 16, 2022), the Task Runner is still classified as unstable:
⚠️ The deno task
feature was introduced in Deno v1.20 and remains unstable.
It may undergo significant changes in future updates.
While I am uncertain about the recommended build tool for Deno, my assumption is that the Task Runner will likely be favored once it stabilizes, given its integration within Deno.