github elbywan/wretch 3.0.3

8 hours ago

3.0.3 (2025-11-10)

🐛 Bug fix(es)

  • Use body size when available to compute upload total bytes (27c0443), closes #278
import wretch from "wretch"
import ProgressAddon from "wretch/addons/progress"

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

wretch("https://httpbin.org/post")
  .addon(ProgressAddon())
  .content("text/plain")
  .body(file)
  .onUpload((loaded, total) => {
    console.log(`Uploaded ${loaded} of ${total}`)
  })
  .post()
  .res(res => console.log(res.status))
  .catch(console.error)
Uploaded 0 of 1100000
Uploaded 589824 of 1100000
Uploaded 1100000 of 1100000

✅ Test improvement(s)

  • Migrate documentation examples from httpbun.org to htt (df84f73)

Don't miss a new wretch release

NewReleases is sending notifications on new releases.