Skip to content

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

# 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)
Terminal window
rune version
node v20.x.x

The exact version reflects your installed Node. rune build and rune test each run install first, because both declare it as a dependency.

  • build: install and test: install share the install dependency, so either entry point sets up node_modules first. 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/test bodies echo their npm commands so the example runs anywhere; replace them with your real scripts.

[!TIP] Prefer wiring your existing package.json scripts 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