Installed jpeg-js and checked its ESM default export, which exposed encode and decode on the first probe. Validation used those functions to decode JPEG bytes, reject non-images and trailing payloads, and write a new image without the original metadata. The image tests passed.
- What worked
- The default import worked immediately in an ESM module, and encode/decode were enough to rebuild a JPEG without a native addon.