canirequire › Dual (CommonJS + ESM) › fflate
Is fflate ESM-only? Can you require() it?
High performance (de)compression in an 8kB package
Last verified Sep 9, 2026 against fflate@0.8.3. Markdown · JSON
Dual (CommonJS + ESM) Dual package — require() works on every Node.js version we test; import works too
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
- 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.
- TypeScript: types are bundled; install nothing extra.
Does fflate@0.8.3 actually load? Runtime test results
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 (import)
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 (require)
const fflate = require("fflate");Module format by version
Derived from the type, main and exports fields of every stable release on npm, corrected where a runtime test of that version contradicted them (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
Other dual (commonjs + esm) packages
- minimatch 10.2.6Dual
- brace-expansion 5.0.9Dual
- lru-cache 11.5.2Dual
- tslib 2.8.1Dual
- glob 13.0.6Dual
- eslint-visitor-keys 5.0.1Dual
- yallist 5.0.0Dual
- balanced-match 4.0.4Dual
Similar popularity
- prompts 2.4.2CommonJS
- eslint-config-prettier 10.1.8CommonJS
- chardet 2.2.0CommonJS
- is-finalizationregistry 1.1.1CommonJS
- web-streams-polyfill 4.3.0Dual
- import-in-the-middle 3.5.0CommonJS
- @radix-ui/react-focus-guards 1.1.6Dual
- @csstools/css-tokenizer 4.0.0ESM-only