Simon Willison on Nostr: A pattern I'm leaning more into at the moment is having code in the browser handle ...
A pattern I'm leaning more into at the moment is having code in the browser handle parsing difficult file formats, then that browser code sends the modified version back to an API on the server
Examples:
- parse a huge CSV/TSV in the browser, send to backend in batches
- ditto for .xlsx
- load a PDF in the browser, extract text with PDF.js, send just the text to the server
- similar trick, but turn the PDF into a JPEG for each page and submit those images
- convert SVG to PNG in the browser
Examples:
- parse a huge CSV/TSV in the browser, send to backend in batches
- ditto for .xlsx
- load a PDF in the browser, extract text with PDF.js, send just the text to the server
- similar trick, but turn the PDF into a JPEG for each page and submit those images
- convert SVG to PNG in the browser