# entry-points

Entry-point discovery for application source code, combining `package.json` declarations with conventional file patterns.

[`discoverEntryPoints`](https://www.hyperfrontend.dev/docs/libraries/project-scope/heuristics/entry-points/#api-discoverEntryPoints) reads [`main`](https://www.hyperfrontend.dev/docs/libraries/project-scope/heuristics/entry-points/#api-EntryPointType), [`module`](https://www.hyperfrontend.dev/docs/libraries/project-scope/project/package/#api-PackageJson-prop-module), [`browser`](https://www.hyperfrontend.dev/docs/libraries/project-scope/project/package/#api-PackageJson-prop-browser), [`bin`](https://www.hyperfrontend.dev/docs/libraries/project-scope/project/package/#api-PackageJson-prop-bin), and [`exports`](https://www.hyperfrontend.dev/docs/libraries/project-scope/project/package/#api-PackageJson-prop-exports) fields from `package.json`, then layers in convention-based candidates (`src/index.ts`, `src/main.ts`, `src/server.ts`, `src/cli.ts`, etc.). Each candidate is returned with a [`confidence`](https://www.hyperfrontend.dev/docs/libraries/project-scope/heuristics/entry-points/#api-ExtendedEntryPointInfo) score, `type` classification ([`main`](https://www.hyperfrontend.dev/docs/libraries/project-scope/heuristics/entry-points/#api-EntryPointType), [`cli`](https://www.hyperfrontend.dev/docs/libraries/project-scope/heuristics/entry-points/#api-EntryPointType), [`server`](https://www.hyperfrontend.dev/docs/libraries/project-scope/heuristics/entry-points/#api-EntryPointType), [`library`](https://www.hyperfrontend.dev/docs/libraries/project-scope/heuristics/entry-points/#api-ENTRY_POINT_PATTERNS), [`worker`](https://www.hyperfrontend.dev/docs/libraries/project-scope/heuristics/entry-points/#api-EntryPointType), ...), and the [`source`](https://www.hyperfrontend.dev/docs/libraries/project-scope/heuristics/entry-points/#api-ExtendedEntryPointInfo-prop-source) that produced it (`package-json` vs [`convention`](https://www.hyperfrontend.dev/docs/libraries/project-scope/heuristics/entry-points/#api-EntryPointSource)). Detection is cached for a short TTL; pass `{ skipCache: true }` for fresh results. The patterns themselves are exposed as [`ENTRY_POINT_PATTERNS`](https://www.hyperfrontend.dev/docs/libraries/project-scope/heuristics/entry-points/#api-ENTRY_POINT_PATTERNS) for downstream tools that need to extend the heuristic.

---

Canonical page: https://www.hyperfrontend.dev/docs/libraries/project-scope/heuristics/entry-points/
This file: https://www.hyperfrontend.dev/docs/libraries/project-scope/heuristics/entry-points.md
Documentation index: https://www.hyperfrontend.dev/llms.txt
