AGENTS.md
tiny-retry is a dependency-free TypeScript library for retrying async functions with backoff. Published to npm as ESM + CJS.
Commands
- Install:
pnpm install - Test:
pnpm test(Vitest); watch:pnpm test --watch - Typecheck:
pnpm typecheck - Build:
pnpm build(tsup, outputsdist/) - Check package exports:
pnpm check:exports(publint + attw)
Rules
- Zero runtime dependencies. Do not add any.
- Public API = exports from
src/index.ts. Changing it requires a changeset (pnpm changeset) with the right bump: breaking -> major. - Every exported function has TSDoc with an
@example. - Supports Node 20+ and modern browsers: no Node-only APIs in
src/(nofs,process,Buffer). - Tests use fake timers (
vi.useFakeTimers()); never realsetTimeoutwaits. - Keep the minified bundle under 2 KB;
pnpm sizechecks it.
Pull requests
- Include a changeset for user-visible changes.
- Update
README.mdexamples if the API changes.