# watskeburt

> List files changed since a git revision

Latest version **6.0.0** (published 2026-06-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install watskeburt
pnpm add watskeburt
yarn add watskeburt
bun add watskeburt
```

Provides the command `watskeburt`.

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.0.0 |
| Published | 2026-06-15 |
| First published | 2022-07-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | ^22.13\|\|^24\|\|>=26 |
| Dependencies | 0 |
| Unpacked size | 16.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 7 |
| Author | Sander Verweij |
| Maintainers | sverweij |
| Keywords | git, diff |

## Links

- npm: https://www.npmjs.com/package/watskeburt
- Repository: https://github.com/sverweij/watskeburt
- Issues: https://github.com/sverweij/watskeburt/issues
- npm.io page: https://npm.io/package/watskeburt

## Recent versions

- 6.0.0 (latest) — 2026-06-15
- 5.0.0-beta-3 (beta) — 2025-09-21
- 5.0.3 — 2026-02-28
- 5.0.2 — 2026-01-22
- 5.0.1 — 2026-01-18
- 5.0.0 — 2025-10-29
- 4.2.3 — 2025-02-14
- 4.2.2 — 2024-12-03
- 4.2.1 — 2024-12-03
- 4.2.0 — 2024-12-02
- 4.1.1 — 2024-11-24
- 4.1.0 — 2024-07-06
- 4.0.2 — 2024-04-13
- 4.0.1 — 2024-03-14
- 4.0.0 — 2024-02-24
- … 35 more at https://npm.io/package/watskeburt/versions

## README

# watskeburt

Get changed files & their statuses since any git _revision_

## :construction_worker: usage

### :scroll: API

```javascript
import { list, getSHA } from "watskeburt";

// print the SHA1 of the current HEAD
console.log(await getSHA());

// list all files that differ between 'main' and the current revision (including
// files not staged for commit and files not under revision control)
/** @type {import('watskeburt').IChange[]} */
const lChangedFiles = await list({ oldRevision: "main" });

// list all files that differ between 'v0.6.1' and 'v0.7.1' (by definition
// won't include files staged for commit and/ or not under revision control)
/** @type {import('watskeburt').IChange[]} */
const lChangedFiles = await list({
  oldRevision: "v0.6.1",
  newRevision: "v0.7.1",
});

// list all files that differ between 'main' and the current revision
// (including untracked files, output as JSON)
/** @type {import('watskeburt').IChange[]|string} */
const lChangedFiles = await list({
  oldRevision: "main",
  trackedOnly: false, // when set to true leaves out files not under revision control
  outputType: "json", // options: "json" and "regex"
});
```

The array of changes this returns looks like this:

```javascript
[
  {
    name: "doc/cli.md",
    type: "modified",
  },
  {
    name: "test/thing.spec.mjs",
    type: "renamed",
    oldName: "test/old-thing.spec.mjs",
  },
  {
    name: "src/not-tracked-yet.mjs",
    type: "untracked",
  },
];
```

### :shell: cli

Works with node >=22

```shell
# list all JavaScript-ish files changed since main in a regular expression
$ npx watskeburt main
^(src/cli[.]mjs|src/formatters/regex[.]mjs|src/version[.]mjs)$
```

This emits a regex that contains all changed files that could be
source files in the JavaScript ecosystem (.js, .mjs, .ts, .tsx ...). It can
be used in e.g. dependency-cruiser's `--focus` and `--reaches` filters.

The JSON output (= the array above, serialized) also contains all other
extensions.

```
Usage: watskeburt [options] [old-revision] [new-revision]

lists files & their statuses since [old-revision] or between [old-revision] and [new-revision].

-> When you don't pass a revision old-revision defaults to the current one.

Options:
  -T, --outputType <type>  what format to emit (choices: "json", "regex", default: "regex")
  --trackedOnly            only take tracked files into account (default: false)
  -V, --version            output the version number
  -e, --extensions <list>  comma separated list of file extensions to consider
                           - pass "*" to consider all extensions
                           - currently applicable only to the "regex" reporter
                           - defaults to most popular extensions in the
                             JavaScript/ TypeScript ecosystem
  -h, --help               display help for command
```

Default list of extensions (cli, regex reporter only):
`"cjs,cjsx,coffee,csx,cts,js,json,jsx,litcoffee,ls,mjs,mts,svelte,ts,tsx,vue,vuex"`.

## why?

I needed something robust to support caching in
[dependency-cruiser](https://github.com/sverweij/dependency-cruiser) and to
run standalone to use _in combination_ with dependency-cruiser.

A few specialized packages like this existed, but they had fallen out of
maintenance. More generic packages still were maintained, but for my use
case they were overkill.

## 🇳🇱 what does 'watskeburt' mean?

Wazzup.

_watskeburt_ is a fast pronunciation of the Dutch "wat is er gebeurd?"
(_what has happened?_) or "wat er is gebeurd" (_what has happened_).

---
_Source: https://npm.io/package/watskeburt · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
