canirequire

canirequireDual (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.

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

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.

Runtimerequire("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).

VersionsFormatFirst published
0.5.0 – 0.8.3Dual (CommonJS + ESM)Jan 12, 2021
0.0.1 – 0.4.9CommonJSSep 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

Similar popularity