🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

htmx.ext...chunked-transfer

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

htmx.ext...chunked-transfer

Chunked transfer encoding extension for htmx.

latest
Source
npmnpm
Version
2.3.0
Version published
Maintainers
1
Created
Source

htmx.ext...chunked-transfer

CI NPM version Conventional Commits

Chunked transfer encoding extension for htmx .

This extension adds Chunked transfer encoding to htmx requests. \following https://github.com/bigskysoftware/htmx/issues/1911

Install

$ npm install htmx.ext...chunked-transfer
<script src="https://unpkg.com/htmx.ext...chunked-transfer/dist/index.js"></script>

Usage

<body hx-ext="chunked-transfer">
  ...
</body>

Swap Mode

By default, chunks are appended to the target element. Use hx-chunked-mode="swap" to replace the previous chunk with each new one:

<form hx-post="/process" hx-ext="chunked-transfer" hx-chunked-mode="swap">
  <button type="submit">Process</button>
</form>

Append mode (default): Accumulates all chunks

Chunk 1: <p>Loading...</p>
Chunk 2: <p>Loading...</p><p>50%</p>
Chunk 3: <p>Loading...</p><p>50%</p><p>Done!</p>

Swap mode: Shows only the latest chunk

Chunk 1: <p>Loading...</p>
Chunk 2: <p>50%</p>           (replaces previous)
Chunk 3: <p>Done!</p>         (replaces previous)

Comment Filtering

Comment-only chunks (heartbeats) are automatically ignored:

<!-- heartbeat -->
← Ignored, no DOM update
<p>Content</p>
← Processed
<!-- debug -->
<p>Content</p>
← Processed (has content)

Examples

Testing

# Unit tests
bun test

# E2E tests (example/oob)
# Terminal 1: Start dev server
bun --cwd example/oob dev

# Terminal 2: Run tests
PUPPETEER_EXECUTABLE_PATH=$(which chromium) bun test ./example/oob/index.test.ts

Keywords

htmx

FAQs

Package last updated on 04 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts