Skip to content

CuplexUser/DocumentReader

Repository files navigation

DocReader

A browser-based viewer for .docx and .xlsx files. Everything runs client-side — uploaded files are parsed and rendered entirely in the browser and never leave your machine.

Features

  • Drag-and-drop or click-to-browse upload for .docx and .xlsx files
  • Browser-tab-style interface for multiple open documents
  • Resizable sidebar (document outline for Word docs, sheet list for Excel workbooks) and main viewer
  • Side-by-side compare mode for two open documents
  • Light/dark theme, persisted across sessions

Getting started

npm install
npm run dev

Building for production

npm run build
npm run preview

Testing

npm test

Regression tests (Vitest + jsdom) cover the pure logic layer: documentsReducer, fileRouter, and the parseDocx/parseXlsx parsers (including that the DOMPurify allowlist actually strips unsafe docx HTML). There are no component/UI tests.

Notes

  • xlsx (SheetJS) is installed at the last version published to the npm registry (0.18.5), which has known advisories (prototype pollution, ReDoS) with no npm-registry fix available — SheetJS only publishes patched builds via their own CDN (cdn.sheetjs.com), which this environment's npm config blocks installing from directly. Since parsing is entirely client-side and single-user (a malicious .xlsx can only affect the browser tab of whoever opens it), this is an accepted risk for now. To pick up the patched build, run npm install https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz from an environment that allows remote tarball installs.

About

A browser-based viewer for `.docx` and `.xlsx` files. Everything runs client-side — uploaded files are parsed and rendered entirely in the browser and never leave your machine.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages