{"_id":"@8865a/repo-viewer","_rev":"4-d67fe6dc075b2e13a8938f72ba1b3350","name":"@8865a/repo-viewer","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"@8865a/repo-viewer","version":"0.1.0","_id":"@8865a/repo-viewer@0.1.0","maintainers":[{"name":"8865a","email":"1450040534@qq.com"}],"bin":{"repo-viewer":"bin/repo-viewer.js"},"dist":{"shasum":"ef7bf6726a7774277bc3dee4797513dd47fb6d7d","tarball":"https://registry.npmjs.org/@8865a/repo-viewer/-/repo-viewer-0.1.0.tgz","fileCount":8,"integrity":"sha512-PFgqSOGhkdmt0RSf3rmV4NqSlAyGHuvraLeTh406WwRVk6g6tOHP+O5Ii05CgONAPXePAOV3Z5aeLdqRNrHmEg==","signatures":[{"sig":"MEYCIQDGShYD7J0oSYELippi8emTECgyOXb4cFa2S5wz4yJdOAIhAMeTjxvwgshvoKZbFeGdllS+ef7jwGAYdJfTQkaRbTOo","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":78435},"type":"module","engines":{"node":">=18"},"gitHead":"a548873a52853d3c0d130a2155ff4e6682bfc20e","scripts":{"check":"node server/index.js --check","start":"node server/index.js"},"_npmUser":{"name":"8865a","email":"1450040534@qq.com"},"_npmVersion":"11.12.1","description":"Local GitHub repository visual browser with file tree, preview, and translation layer.","directories":{},"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/repo-viewer_0.1.0_1781496493062_0.9490656995537143","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@8865a/repo-viewer","version":"0.1.1","_id":"@8865a/repo-viewer@0.1.1","maintainers":[{"name":"8865a","email":"1450040534@qq.com"}],"bin":{"repo-viewer":"bin/repo-viewer.js"},"dist":{"shasum":"c4cc3f7e5d70a65486f90f631e1d0486da65aa58","tarball":"https://registry.npmjs.org/@8865a/repo-viewer/-/repo-viewer-0.1.1.tgz","fileCount":8,"integrity":"sha512-KpRKM6sD4GyYWzheS0BxH6+GS4rUb8lde66IBOxoH/QaLpsvUZY2eNTpFenP84O8U+eWrd73DY9OXn3NGqg8Yg==","signatures":[{"sig":"MEUCIQDaeUmLjC35oxtEvQP0ateGiOtDFbPCWjXhxOZUGm50sQIgbacAOLVJVzJx4FNa40ZS0eUzJHjv3kHs/YeChGu5mJY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":89043},"type":"module","engines":{"node":">=18"},"gitHead":"a548873a52853d3c0d130a2155ff4e6682bfc20e","scripts":{"check":"node server/index.js --check","start":"node server/index.js"},"_npmUser":{"name":"8865a","email":"1450040534@qq.com"},"_npmVersion":"11.12.1","description":"Local GitHub repository visual browser with file tree, preview, and translation layer.","directories":{},"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/repo-viewer_0.1.1_1781499431454_0.5637041061468959","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@8865a/repo-viewer","version":"0.1.2","_id":"@8865a/repo-viewer@0.1.2","maintainers":[{"name":"8865a","email":"1450040534@qq.com"}],"bin":{"repo-viewer":"bin/repo-viewer.js"},"dist":{"shasum":"53a223a81421a2553cbec2b9f625e1ecc69cd8d1","tarball":"https://registry.npmjs.org/@8865a/repo-viewer/-/repo-viewer-0.1.2.tgz","fileCount":8,"integrity":"sha512-YKqqNqEEm84ysUMeswbiGC8Hi/Tg7DrynEktDxM4yZcU0NuxHDr/d6ThTMZSiKUZOmo+mfzDuJnIjhzaAbAqZg==","signatures":[{"sig":"MEUCIA3BqbBcXcmpKXfYWjfLAp4aFyrc/KAJoN6MibhHSHm4AiEAr8bE/ZSWI6tElPNLYfP9w9nodoSXSh4lLO4FMMdwT+U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":94380},"type":"module","engines":{"node":">=18"},"gitHead":"e5e6144158efb38b70da1092cfcda05b85c0594a","scripts":{"check":"node server/index.js --check","start":"node server/index.js"},"_npmUser":{"name":"8865a","email":"1450040534@qq.com"},"_npmVersion":"11.12.1","description":"Local GitHub repository visual browser with file tree, preview, and translation layer.","directories":{},"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/repo-viewer_0.1.2_1781500578803_0.8957374183764104","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@8865a/repo-viewer","version":"0.1.3","type":"module","description":"Local GitHub repository visual browser with file tree, preview, and translation layer.","bin":{"repo-viewer":"bin/repo-viewer.js"},"scripts":{"start":"node server/index.js","check":"node server/index.js --check"},"publishConfig":{"access":"public"},"engines":{"node":">=18"},"gitHead":"e5e6144158efb38b70da1092cfcda05b85c0594a","_id":"@8865a/repo-viewer@0.1.3","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-IOGnO8oapYYBxVK4xTxxgG28jVmRelXOI8IhiC/M9ahvkI71vnlOvNG2ueVJfgm9XxJV1fAA35vwbsnOi0jtQQ==","shasum":"327737c14117b879ad5b2197bea020b2cdecf875","tarball":"https://registry.npmjs.org/@8865a/repo-viewer/-/repo-viewer-0.1.3.tgz","fileCount":8,"unpackedSize":91871,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHVOaj5+uMrR50nHswUt6baGJOSnjMwt2RKKodd5EIJ8AiEA/5lUmbPFIrP6SVbiPYj3YMaP8vTGLJnqLl9MXrahJls="}]},"_npmUser":{"name":"8865a","email":"1450040534@qq.com"},"directories":{},"maintainers":[{"name":"8865a","email":"1450040534@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/repo-viewer_0.1.3_1781501687812_0.9930010366186588"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-15T04:08:12.889Z","modified":"2026-06-15T05:34:48.052Z","0.1.0":"2026-06-15T04:08:13.210Z","0.1.1":"2026-06-15T04:57:11.588Z","0.1.2":"2026-06-15T05:16:18.942Z","0.1.3":"2026-06-15T05:34:47.951Z"},"description":"Local GitHub repository visual browser with file tree, preview, and translation layer.","maintainers":[{"name":"8865a","email":"1450040534@qq.com"}],"readme":"# Repo Viewer\n\nRepo Viewer is a local web app for reading GitHub repositories as a browsable, translated workspace. It focuses on large repositories: directories are loaded on demand, files open in a preview pane, and Markdown/text files can be shown side by side with a Chinese translation.\n\n## Features\n\n- Local repository reader: paste any local repository path.\n- Lazy file explorer: only the opened directory is scanned, so startup stays fast on large repos.\n- Code preview: readable line numbers and light code blocks by default.\n- Markdown preview: headings, lists, code blocks, inline code, links, and local images.\n- Default Chinese comparison: Markdown/text files open in source + Chinese translation view.\n- Translation optimization: common code/config files are skipped, Markdown code blocks/inline code are preserved, and text is batched to reduce provider calls.\n- Translation feedback: the translated pane shows a loading animation while a translation is running.\n- Translation providers: repository-local translations, free Google endpoint with MyMemory fallback, or MyMemory.\n- Themes: paper, light, dark, eye-care green, and high contrast.\n\n## Run with npx\n\n```bash\nnpx @8865a/repo-viewer C:\\path\\to\\repo\n```\n\nOr pass options explicitly:\n\n```bash\nnpx @8865a/repo-viewer --root C:\\path\\to\\repo --port 4173\n```\n\nThe command starts a local web server and prints the browser URL:\n\n```text\nRepo Viewer running at http://localhost:4173\n```\n\nIf no repository path is provided, Repo Viewer opens the current working directory.\n\n## Global install\n\n```bash\nnpm install -g @8865a/repo-viewer\nrepo-viewer C:\\path\\to\\repo\n```\n\nUseful CLI options:\n\n```bash\nrepo-viewer --help\nrepo-viewer --version\nrepo-viewer --check --root C:\\path\\to\\repo\nrepo-viewer --root C:\\path\\to\\repo --port 4180\n```\n\n## Local development\n\n```bash\nnpm start\n```\n\nOpen:\n\n```text\nhttp://localhost:4173\n```\n\nBy default the app reads the current working directory.\n\nTo open another local repository, paste its absolute path into the top input and click `读取`, or pass it in the URL:\n\n```text\nhttp://localhost:4173/?root=C:\\path\\to\\repo\n```\n\n## Translation\n\nTranslation is resolved in this order:\n\n1. Repository translation files, such as `README.zh-CN.md` or `docs/zh-CN/README.md`.\n2. The configured provider in the page `配置` dialog.\n3. Local glossary fallback for offline demos.\n\nFree providers:\n\n```env\nTRANSLATE_PROVIDER=google-free\n```\n\n`google-free` is the default provider when no local translation config exists.\n\n```env\nTRANSLATE_PROVIDER=mymemory-free\n```\n\n`google-free` uses an unofficial Google Translate endpoint. It needs no API key. `mymemory-free` also needs no API key and is best for shorter text.\n\n## Translation diagnostics and proxy\n\nRepo Viewer prints translation diagnostics in the terminal by default. The logs include the selected provider, chunk count, HTTP host, proxy source, elapsed time, and fallback reason. They do not print source document text or API keys.\n\nMarkdown text is translated in batches while fenced code blocks and inline code are kept out of translation requests. The default batch settings reduce many tiny translation calls:\n\n```env\nTRANSLATE_BATCH_CHARS=3200\nTRANSLATE_BATCH_ITEMS=24\n```\n\nTranslation proxy is configured explicitly in the page `配置` dialog. It is not auto-detected from the operating system. The default proxy URL is:\n\n```env\nTRANSLATE_PROXY_ENABLED=1\nTRANSLATE_PROXY_URL=http://127.0.0.1:7897\n```\n\nThe same proxy setting is used on Windows, macOS, and Linux. Turn it off in the dialog when the machine does not have a local proxy, or change the URL to the user's proxy port.\n\nUseful diagnostics:\n\n```powershell\n$env:TRANSLATE_LOG=\"1\"\nnpx @8865a/repo-viewer --check --root C:\\path\\to\\repo\nnpx @8865a/repo-viewer C:\\path\\to\\repo\n```\n\nTo turn translation logs off:\n\n```powershell\n$env:TRANSLATE_LOG=\"0\"\n```\n\nWhen running through the CLI, the page configuration dialog writes to `.repo-viewer.env` in the directory where the command was started. In local development it writes to `.env` in this project. Both files are ignored by git.\n\n## API\n\n- `GET /api/tree?root=<path>&path=<dir>`: read one directory level.\n- `GET /api/file?root=<path>&path=<file>`: read a file preview.\n- `GET /api/raw?root=<path>&path=<file>`: stream raw assets.\n- `POST /api/translate`: translate Markdown/text while preserving code.\n- `GET /api/translation-status`: inspect translation provider status.\n- `POST /api/translation-config`: save translation provider settings.\n","readmeFilename":"README.md"}