Download Latest Version 3.0.7 source code.tar.gz (319.8 kB)
Email in envelope

Get an email when there's a new version of Wretch

Home / 3.0.4
Name Modified Size InfoDownloads / Week
Parent folder
3.0.4 source code.tar.gz 2025-11-26 283.2 kB
3.0.4 source code.zip 2025-11-26 453.4 kB
README.md 2025-11-26 1.5 kB
Totals: 3 Items   738.1 kB 0

3.0.4 (2025-11-26)

:bug: Bug fix(es)

  • Improve body size computation when tracking upload progress (bfae158), closes #284

    :::ts import wretch from "wretch" import FormDataAddon from "wretch/addons/formData" import ProgressAddon from "wretch/addons/progress"

    const testString = Array(1_000).fill("This is a test string.") const file = new File(testString, "test.txt", { type: "text/plain" })

    wretch("https://httpbingo.org/post") .addon([ProgressAddon(), FormDataAddon]) .formData({ "textfile": file, }) .onUpload((loaded, total) => { console.log(Uploaded ${loaded} of ${total}) }) .post() .res(res => console.log(res.status)) .catch(console.error)

    "total" is now correctly inferred:

    Uploaded 0 of 22174 Uploaded 134 of 22174 Uploaded 156 of 22174 Uploaded 178 of 22174 Uploaded 200 of 22174 Uploaded 222 of 22174

    (…)

    Uploaded 22090 of 22174 Uploaded 22112 of 22174 Uploaded 22134 of 22174 Uploaded 22136 of 22174 Uploaded 22174 of 22174 200

:arrow_up: Version update(s)

Source: README.md, updated 2025-11-26