canirequire

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

  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.
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.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).

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") 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

Similar popularity