Getting started
This page takes you from nothing to a first report in a couple of minutes.
Requirements
- Node.js 22.18 or newer. edgefit runs on Node even when the project you check targets Bun or Deno.
- Your project's dependencies installed, so
node_modulesexists. edgefit reads the packages you actually ship.
Try it without installing
npx edgefit checkIf your project has a wrangler.jsonc, wrangler.json or wrangler.toml, that is all you need. edgefit reads the entry point from wrangler's main, along with the compatibility date and flags.
For any other project, point it at the entry file:
npx edgefit check --entry src/index.tsInstall it in the project
Installing edgefit as a dev dependency pins the version, which also pins the compatibility data, and gives your config file types.
npm install --save-dev edgefitpnpm add --save-dev edgefityarn add --dev edgefitbun add --dev edgefitThen add a script:
{
"scripts": {
"edgefit": "edgefit check"
}
}Your first check
Run the check
npx edgefit check --entry src/index.tsRead the header
edgefit · workerd (Cloudflare Workers)
entry src/index.ts · 5 modules · conditions workerd, worker, browser
data workers-nodejs-compat-matrix@ee58120 (workerd 1.20260929.1), ...
settings compatibility_date 2026-09-29, flags: nodejs_compat (from wrangler.jsonc)The header says which target was checked, how many modules were reached, which export conditions were used, which data the results come from, and where the runtime settings were read from.
Read the findings
error unsupported node:fs.watch (workerd)
file watching is not implemented; throws ERR_UNSUPPORTED_OPERATION
chokidar@4.0.1 node_modules/chokidar/index.js:5:13
via src/index.ts > src/dev/reload.ts > chokidar
warning unknown require(<expression>) (workerd)
cannot be checked statically: the module name is computed at runtime
pg-lite@0.3.0 node_modules/pg-lite/lib/index.js:12:10
via src/index.ts > pg-lite
1 error, 1 warningEach finding starts with its level and category. The via line is the import chain: follow it to see why a package is in your graph at all.
Fix or accept
Remove the import that pulls the package in, swap it for one that supports the runtime, or, if the code path never runs in production, ignore it with a reason.
Check more than one runtime
Pass --target more than once. The same entry is used for every target.
npx edgefit check --target workerd --target bun --target denoTo see the results side by side, use edgefit compare.
Exit codes
| Code | Meaning |
|---|---|
0 | No error-level findings |
1 | At least one error-level finding |
2 | Invalid input, or a project that could not be resolved |
Warnings never fail the run. You can raise or lower any category with levels.
Next
- Reading findings explains every category.
- Configuration covers
edgefit.config.ts. - Pull request checks runs edgefit on every pull request.