# Is fflate ESM-only? Can you require() it?

> fflate@0.8.3 ships CommonJS and ESM builds. Dual package — require() works on every Node.js version we test; import works too.

High performance (de)compression in an 8kB package

Last verified Sep 9, 2026 against fflate@0.8.3.

fflate publishes both a CommonJS entry and a native ESM entry (ESM added in 0.5.0). require("fflate") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. import "fflate" works alongside it.

## What to do

1. Nothing to change. require("fflate") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. import * as fflate from "fflate" works alongside it; use named imports for what the ESM entry exports.
2. TypeScript: types are bundled; install nothing extra.

## Facts

- Latest: 0.8.3 (May 16, 2026)
- Module format: Dual (CommonJS + ESM)
- Last CommonJS version: 0.8.3
- Native ESM since: 0.5.0
- TypeScript types: bundled
- Node engines: not declared
- Weekly downloads: 53.5M
- License: MIT

## Runtime test results for fflate@0.8.3

Installed and executed on Sep 9, 2026 with require("fflate") from a CommonJS file and import "fflate" from an ES module.

| Runtime | require("fflate") | import "fflate" |
|---|---|---|
| Node.js 18 | works | works |
| Node.js 20 | works | works |
| Node.js 22 | works | works |
| Node.js 24 | works | works |
| Node.js 26 | works | works |
| Bun 1.4.0 | works | works |

## How to import fflate

ES modules:

```js
import * as fflate from "fflate";
```

Namespace import shown because the ESM entry may have no default export; use named imports for what it exports.

CommonJS:

```js
const fflate = require("fflate");
```

## Module format by version

Derived from the type, main and exports fields of every stable release on npm (58 versions; the newest 58 shown).

| Versions | Format | First published |
|---|---|---|
| 0.5.0 – 0.8.3 | Dual (CommonJS + ESM) | Jan 12, 2021 |
| 0.0.1 – 0.4.9 | CommonJS | Sep 20, 2020 |

## Frequently asked

**Is fflate ESM-only?**

fflate@0.8.3 ships CommonJS and ESM builds. fflate publishes both a CommonJS entry and a native ESM entry (ESM added in 0.5.0). require("fflate") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. import "fflate" works alongside it.

**Can I require fflate?**

Yes. fflate ships a CommonJS entry alongside the native ESM entry. require("fflate") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun.

**Does fflate work in Bun?**

Yes. import "fflate" loaded successfully in Bun 1.4.0 on Sep 9, 2026.

**Does fflate ship TypeScript types?**

Yes. fflate bundles its own type declarations; no @types package is needed.

## Links

- [fflate on npm](https://www.npmjs.com/package/fflate)
- [Source repository](https://github.com/101arrowz/fflate)
- [HTML version](https://canirequire.com/package/fflate/)
- [JSON version](https://canirequire.com/package/fflate.json)

---

For scripts and AI agents: any package is at https://canirequire.com/package/<name>/index.md (Markdown) or https://canirequire.com/package/<name>.json (JSON); the site index is https://canirequire.com/llms.txt. Fetch the URL directly; no search needed.
