canirequire

canirequireCommonJS › dumi

Is dumi ESM-only? Can you require() it?

📖 Documentation Generator of React Component

Latest version 2.4.49, published Aug 12, 2026. JSON

CommonJS CommonJS — require() works on every Node.js version

dumi ships CommonJS only. require("dumi") works everywhere. import "dumi" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.

Latest
2.4.49 (Aug 12, 2026)
Module format
CommonJS
Last CommonJS version
2.4.49
TypeScript types
Bundled
Node engines
not declared
Weekly downloads
44K
License
MIT

Does dumi@2.4.49 actually load? Runtime test results

Runtime probe pending for this version. The values below are what package.json declares; they are refreshed once the probe runs.

Runtimerequire("dumi")import "dumi"
Node.js 18✓ expected✓ expected
Node.js 20✓ expected✓ expected
Node.js 22✓ expected✓ expected
Node.js 24✓ expected✓ expected
Node.js 26✓ expected✓ expected
Bun 1.4pendingpending

Install failed in our sandbox: PROBE_TIMEOUT The rows above show what package.json declares.

How to import dumi

ES modules (import)

import dumi from "dumi";

Named imports from a CommonJS package only work when Node.js can statically detect them. If a named import fails, use the default import and destructure.

CommonJS (require)

const dumi = require("dumi");

Module format by version

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

VersionsFormatFirst published
2.2.15 – 2.4.49CommonJSDec 11, 2023

Frequently asked

Is dumi ESM-only?

dumi@2.4.49 is a CommonJS package. dumi ships CommonJS only. require("dumi") works everywhere. import "dumi" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.

Can I import dumi with ES module syntax?

Yes. import dumi from "dumi" works in Node.js and Bun because they support importing CommonJS modules. Named imports work only when Node.js can statically detect the exports.

Does dumi ship TypeScript types?

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

Links

Other commonjs packages

Similar popularity