# Task Runner

> A tool that runs a project's jobs by name, like npm run build.

**Field:** Software Development  
**Category:** Editors & Tools  
**Also known as:** npm scripts, npm run, Script Runner

## Think of it like

It is like a row of buttons, each with a name. Press one, and that whole job runs.

## Definition

A task runner is a tool that runs named jobs for a project with one short command. Each task is a name tied to the real commands, like build, test or lint. In a JavaScript project, the tasks live in the scripts part of package.json. You then type npm run build, not the long command behind it. So everyone on the team runs each job the same way.

## Example

Emma joins a project and reads package.json. She sees tasks named dev, test and lint, so she knows what to type.

## Example code

```json
"scripts": {
  "dev": "vite",
  "build": "vite build",
  "test": "vitest"
}
```

Three named tasks. npm run build now runs vite build for anyone.

## Why it matters

New people do not have to guess the commands. The same names work on every computer and in CI.

## Common mistake

Keeping the real commands in a note or in your head. Put them in tasks, where the whole team can run them.

## Three principles

- **Named jobs.** A short name for a long command.
- **Kept in the project.** Everyone gets the same list.
- **Same in CI.** The pipeline runs the same names.

## Related terms

- [Build Tool](https://learn.benibix.com/term/development/build-tool)
- [package.json](https://learn.benibix.com/term/development/package-json)
- [npm](https://learn.benibix.com/term/development/npm)
- [Make (Build Tool)](https://learn.benibix.com/term/development/make-build-tool)
- [CI/CD Pipeline](https://learn.benibix.com/term/development/ci-cd-pipeline)

## Told apart from

- [Build Tool vs Task Runner](https://learn.benibix.com/compare/build-tool-vs-task-runner): People think a task runner is a build tool, and they are not the same. A task runner just gives a short name to a command, like build or test. A build tool knows which files each step needs. It runs the steps in order and skips the ones that are already done.

## Taught in

- [Task Runners and Scaffolding](https://learn.benibix.com/learn/development-tools/task-runners-and-scaffolding): Coding Tools, 13/13

![Source files on the left go into a build tool in the middle, which reads a recipe file: a Makefile, a pom.xml or a build.gradle.kts. Inside the tool, three steps run in order: compile, test, package. On the right comes the result, a program or a jar file. Below, a task runner row shows npm run build running the real command behind it, vite build.](https://learn.benibix.com/diagrams/dev5-build-tool.svg)

---

Source: https://learn.benibix.com/term/development/task-runner
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
