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. JSON
Dual (CommonJS + ESM) Dual package — both require() and import work
fflate publishes both a CommonJS entry and a native ESM entry (ESM added in 0.5.0). require("fflate") and import "fflate" both work on every supported Node.js version and in Bun.
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 | ✓ works | ✓ works |
How to import fflate
ES modules (import)
import fflate from "fflate";CommonJS (require)
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") and import "fflate" both work on every supported Node.js version and in Bun.
Can I require fflate?
Yes. fflate ships a CommonJS entry, so require("fflate") works on every Node.js version, alongside the native ESM entry for import.
Does fflate work in Bun?
Yes. import "fflate" loaded successfully in Bun 1.4 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
- glob 13.0.6Dual
- eslint-visitor-keys 5.0.1Dual
- yallist 5.0.0Dual
- balanced-match 4.0.4Dual
- js-yaml 5.4.1Dual
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
- bignumber.js 11.1.5Dual
- colorette 2.0.20Dual