{"id":22975869,"url":"https://github.com/printf83/prime-number","last_synced_at":"2026-07-07T09:31:01.906Z","repository":{"id":38449908,"uuid":"493944611","full_name":"printf83/prime-number","owner":"printf83","description":"Prime number calculator","archived":false,"fork":false,"pushed_at":"2026-05-22T21:18:12.000Z","size":542,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-22T22:26:55.036Z","etag":null,"topics":["calculator-javascript","primenumber"],"latest_commit_sha":null,"homepage":"https://printf83.github.io/prime-number/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/printf83.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-19T06:16:39.000Z","updated_at":"2026-05-22T21:18:11.000Z","dependencies_parsed_at":"2022-08-19T15:52:43.483Z","dependency_job_id":null,"html_url":"https://github.com/printf83/prime-number","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/printf83/prime-number","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/printf83%2Fprime-number","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/printf83%2Fprime-number/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/printf83%2Fprime-number/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/printf83%2Fprime-number/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/printf83","download_url":"https://codeload.github.com/printf83/prime-number/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/printf83%2Fprime-number/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35223382,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-07T02:00:07.222Z","response_time":90,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calculator-javascript","primenumber"],"created_at":"2024-12-15T00:39:58.928Z","updated_at":"2026-07-07T09:31:01.881Z","avatar_url":"https://github.com/printf83.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prime Number Calculator\n\nA small browser app that checks numbers for primality and renders prime lists using Web Workers for responsive computation.\n\n## Features\n\n- TypeScript-powered frontend\n- Web Worker-based prime and factor calculations\n- Segmented Sieve of Eratosthenes for normal prime range searches\n- Vite development server and production build\n- Accessible UI using semantic buttons, ARIA progress indicators, and tooltip roles\n- Supports both JavaScript `number` mode and `BigInt` mode\n- Incremental single-prime factorization UI with live progress and scrollable divisor tables\n- Modular UI code split into builders, events, and actions\n\n## Getting Started\n\n### Install\n\n```bash\npnpm install\n```\n\n### Development\n\n```bash\npnpm dev\n```\n\nOpen the local URL shown by Vite.\n\n### Build\n\n```bash\npnpm build\n```\n\n### Preview\n\n```bash\npnpm preview\n```\n\n### GitHub Pages Deployment\n\n```bash\npnpm deploy\n```\n\nThis builds the app with `vite build --base=./` and publishes the `dist` directory to the repository's `gh-pages` branch.\n\n### Type checking and linting\n\n```bash\npnpm typecheck\npnpm lint\n```\n\n## Project Structure\n\n- `index.html` — app shell and Vite entry point\n- `package.json` — scripts and dev dependencies\n- `tsconfig.json` — TypeScript configuration\n- `src/index.ts` — bootstrap and global window bindings\n- `src/workers.ts` — typed worker loader using Vite `new URL(..., import.meta.url)` paths\n- `src/ui/` — split UI implementation\n    - `builders.ts` — HTML fragment builders and accessible controls\n    - `events.ts` — DOM event wiring and button handlers\n    - `actions.ts` — UI state flow and worker orchestration\n- `src/dom.ts` — DOM helpers, tooltip display, accessible progress updates, and render timing\n- `src/utils.ts` — formatting and input parsing helpers\n- `src/state.ts` — shared app state and window typing\n- `src/*.ts` — worker scripts for both normal and BigInt prime calculation modes\n\n## Accessibility Improvements\n\n- Buttons are rendered as `\u003cbutton\u003e` elements with `aria-label`\n- Progress bars use `role=\"progressbar\"` and update `aria-valuenow`\n- Tooltip markup includes `role=\"tooltip\"` and `aria-live=\"polite\"`\n- Result containers use `role=\"status\"` for screen reader updates\n\n## Notes\n\n- Normal prime range searches now use a segmented Sieve of Eratosthenes for much better performance\n- BigInt mode is available for values outside the safe JavaScript integer range, but ordinary `number` mode is still faster for typical ranges\n- Single-prime checks now update incrementally with divisor row rendering rather than rebuilding the full factor display each time\n- Tooltip prime checks show live progress and append factor rows as they are discovered\n- Vite is used as the build/dev server; no manual `dist/` worker path generation is required\n- Web workers are loaded as modules with Vite-compatible URLs\n- The app avoids inline `javascript:void(0)` and anchor-only click handlers\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprintf83%2Fprime-number","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprintf83%2Fprime-number","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprintf83%2Fprime-number/lists"}