Concept Layers
Nudo is designed so you only learn what you need.
Day 0 — Zero concepts
Write plain JavaScript. Run inference:
npx nudojs infer ./src/app.js
You get call-site cases: concrete inputs → inferred results. No annotations, no config.
Open the same file in VS Code with the Nudo extension for hover and inlays.
Default analysis mode:
nudo.analysis.modedefaults to"exports". Files withexport/ sidecar / directives are analyzed by the IDE; set"all"for every target path or"directives"for the conservative gate. CLIinferon a named path still analyzes any target file.
Stop here if you only want types for existing JS.
Day 1 — Sidecar contracts
When you need obligations (check gates in CI), add a sidecar next to the source:
// math.js
export function add2(x) {
return x + 2;
}
// math.nudo.js
export const add2 = number().gt(0);
npx nudojs check ./src/math.js
Contracts come only from:
- explicit sidecars (
*.nudo.js) /@nudo:refine - call-site facts observed by the analyzer
No evidence → any/unknown. Nudo does not invent required slots from body AST scans.
Advanced — Abs
The internal type is Abs (shape × term × pred × conf): types are computable values. nudo check --verbose shows the lossless Abs face. You rarely need this for day-to-day work.