Use case: managing a Node / JavaScript project
Capture the npm workflow for a Node project —
install,build,test— and run a task body in JavaScript under the node executor. This walkthrough assumes you already have a Node project; adapt the echoed npm commands to your real ones.
Backing example: examples/node-project ·
Features: dependencies, executors (node) ·
Prerequisites: node
The Runefile
Section titled “The Runefile”# Tasks for a Node/JavaScript project. The `version` task body runs under the# node executor (real JavaScript); the rest echo the npm commands to adapt.
# Install dependencies.install: @echo "npm install"
# Build the project (depends on install).build: install @echo "npm run build"
# Run the test suite.test: install @echo "npm test"
# Print the Node.js version — body runs under the node executor.version (node): console.log("node " + process.version)Run it
Section titled “Run it”rune versionnode v20.x.xThe exact version reflects your installed Node. rune build and rune test each run
install first, because both declare it as a dependency.
Why it’s written this way
Section titled “Why it’s written this way”build: installandtest: installshare theinstalldependency, so either entry point sets upnode_modulesfirst. See Dependencies & post-hooks.version (node)uses the node executor: the body is real JavaScript run through Node. Reach for it when a task is cleaner in JS than in shell. See Executors.- The
install/build/testbodies echo their npm commands so the example runs anywhere; replace them with your real scripts.
[!TIP] Prefer wiring your existing
package.jsonscripts as the task bodies (npm run build) rather than duplicating logic — Rune becomes the single, discoverable entry point.
Next: AI agents (MCP) · Python project · Executors