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

> dumi@2.4.49 is a CommonJS package. CommonJS — require() works on every Node.js version we test.

📖 Documentation Generator of React Component

Latest version 2.4.49, published Aug 12, 2026.

dumi ships CommonJS only. require("dumi") should work on every Node.js version the package supports; the runtime probe has not run for this version. 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.

## What to do

1. require("dumi") should work on every Node.js version the package supports; the runtime probe has not run for this version.
2. From ES modules use the default import: import dumi from "dumi"; then destructure. Named imports only work when Node.js can statically detect the exports.
3. TypeScript: types are bundled; install nothing extra.

## Facts

- 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

## Runtime test results for dumi@2.4.49

Runtime probe pending for this version (install failed: PROBE_TIMEOUT). The facts above come from package.json.

## How to import dumi

ES modules:

```js
import dumi from "dumi";
```

CommonJS:

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

| Versions | Format | First published |
|---|---|---|
| 2.2.15 – 2.4.49 | CommonJS | Dec 11, 2023 |

## Frequently asked

**Is dumi ESM-only?**

dumi@2.4.49 is a CommonJS package. dumi ships CommonJS only. require("dumi") should work on every Node.js version the package supports; the runtime probe has not run for this version. 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

- [dumi on npm](https://www.npmjs.com/package/dumi)
- [Source repository](https://github.com/umijs/dumi)
- [HTML version](https://canirequire.com/package/dumi/)
- [JSON version](https://canirequire.com/package/dumi.json)

---

For scripts and AI agents: any package is at https://canirequire.com/package/<name>/index.md (Markdown) or https://canirequire.com/package/<name>.json (JSON); the site index is https://canirequire.com/llms.txt. Fetch the URL directly; no search needed.
