Task runnerIntroduction

Introduction

High-performance monorepo task runner with intelligent caching

Task Runner

High-performance monorepo task runner with intelligent caching, dependency-aware scheduling, and auto-fingerprinting.

@visulima/task-runner provides the core building blocks for running tasks in monorepos with maximum cache hit rates. It supports both explicit input declarations (like Nx) and automatic file access tracking (like Vite Task).

Why Task Runner?

  • Two caching modes - Choose Nx-style explicit inputs or Vite Task-style auto-fingerprinting
  • Smart lockfile hashing - Lockfile changes only bust cache for affected packages
  • Framework env inference - Auto-detects Next.js, Vite, CRA, Gatsby, Nuxt, Expo, and more
  • Remote caching - Turborepo-compatible HTTP cache protocol
  • Native Rust addon - Optional xxHash-based parallel file hashing
  • Dependency-aware scheduling - Topological ordering with priority-based batching
  • Incremental hashing - mtime-based change detection for near-instant cache checks
  • Affected detection - Git diff-based filtering
  • Run summaries - Detailed JSON reports for debugging cache behavior
  • Cache diagnostics - Explains exactly why a cache miss occurred

Quick Start

import { defaultTaskRunner } from "@visulima/task-runner";

const results = await defaultTaskRunner(tasks, {
    smartLockfileHashing: true,
    frameworkInference: true,
    globalInputs: ["pnpm-lock.yaml", "tsconfig.base.json"],
    globalEnv: ["NODE_ENV"],
}, context);

How It Works

  1. Build the task graph - Define tasks and their dependencies
  2. Compute cache keys - Hash file contents, env vars, and command arguments
  3. Check cache - Skip execution if inputs haven't changed
  4. Execute tasks - Run in parallel, respecting dependency order
  5. Store results - Cache terminal output and build artifacts for next time

Comparison

FeatureTask RunnerNxTurborepoVite Task
Input detectionBoth modesExplicitExplicitAutomatic
Output cachingYesYesYesTerminal only
Remote cacheYesYesYesNo
Smart lockfile hashYesNoYesNo
Framework inferenceYesNoYesNo
Auto-fingerprintingYesNoNoYes
Cache diagnosticsYesPartialNoYes
LRU cache evictionYesNoNoNo
Graph visualizationYesYesNoNo
Run summariesYesNoYesNo
Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues