# ReadStat for the web (johnmcm.com) The WebAssembly module behind johnmcm.com's SPSS & SAS Viewer (/spss-viewer): [ReadStat](https://github.com/WizardMac/ReadStat) by Evan Miller (MIT), at commit `835b88c8c79d00fcd028c9cfa1226de2fd18be20`, with zlib (for .zsav), behind a few plain C functions in `src/wrapper.c`. The wrapper reads from memory through ReadStat's I/O hooks and keeps the data column by column - numbers as doubles with a missing-value code (system, user-defined, or the tag of a tagged missing value), text as UTF-8 with offsets - and the metadata (variables, labels, formats, user-missing ranges, value-label sets, notes) as JSON. It also reads a SAS format catalog (.sas7bcat) for the value labels of a .sas7bdat. `Dockerfile` builds it with the Emscripten image pinned by digest, compiling ReadStat's readers only (no writers, tools or tests), unmodified. Run `build.ps1` with Docker Desktop running; the module goes to `frontend/vendor/local/readstat@1/`. Licence notices: `LICENSE-ReadStat.txt` is ReadStat's LICENSE at the commit above; `LICENSE-zlib.txt` is zlib's LICENSE at v1.3.2, the version the Emscripten 6.0.10 zlib port builds. The built module in `vendor/local/readstat@1/` carries no notice of its own, so these stand for it.