canirequire › Dual (CommonJS + ESM) › estree-walker
Is estree-walker ESM-only? Can you require() it?
Traverse an ESTree-compliant AST
Last verified Sep 9, 2026 against estree-walker@3.0.3. JSON
Dual (CommonJS + ESM) Dual package — both require() and import work
estree-walker publishes both a CommonJS entry and a native ESM entry (ESM added in 2.0.2). require("estree-walker") and import "estree-walker" both work on every supported Node.js version and in Bun.
Does estree-walker@3.0.3 actually load? Runtime test results
Installed and executed on Sep 9, 2026 with require("estree-walker") from a CommonJS file and import "estree-walker" from an ES module.
| Runtime | require("estree-walker") | import "estree-walker" |
|---|---|---|
| Node.js 18 | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED | ✓ works |
| Node.js 20 | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED | ✓ works |
| Node.js 22 | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED | ✓ works |
| Node.js 24 | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED | ✓ works |
| Node.js 26 | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED | ✓ works |
| Bun 1.4 | ✗ failserror: Cannot find package 'estree-walker' from '/Users/boat/Projects/top-seo/data/probe-work/estree-walker/req.cjs' | ✓ works |
A failing require() on a CommonJS package usually means the package needs a browser/DOM global, a peer dependency, or a native binary that is not available in a bare Node.js process.
How to import estree-walker
ES modules (import)
import estreeWalker from "estree-walker";CommonJS (require)
const estreeWalker = require("estree-walker");Module format by version
Derived from the type, main and exports fields of every stable release on npm (27 versions; the newest 27 shown).
| Versions | Format | First published |
|---|---|---|
| 3.0.1 – 3.0.3 | Dual (CommonJS + ESM) | Dec 20, 2021 |
| 3.0.0 | ESM-only | Jan 29, 2021 |
| 2.0.2 | Dual (CommonJS + ESM) | Dec 8, 2020 |
| 0.1.0 – 2.0.1 | CommonJS | Apr 9, 2015 |
Frequently asked
Is estree-walker ESM-only?
estree-walker@3.0.3 ships CommonJS and ESM builds. estree-walker publishes both a CommonJS entry and a native ESM entry (ESM added in 2.0.2). require("estree-walker") and import "estree-walker" both work on every supported Node.js version and in Bun.
Can I require estree-walker?
Yes. estree-walker ships a CommonJS entry, so require("estree-walker") works on every Node.js version, alongside the native ESM entry for import.
Does estree-walker work in Bun?
Yes. import "estree-walker" loaded successfully in Bun 1.4 on Sep 9, 2026.
Does estree-walker ship TypeScript types?
Yes. estree-walker 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
- node-releases 2.0.55ESM-only
- onetime 8.0.0ESM-only
- fdir 6.5.0Dual
- pnpm 12.3.4ESM-only
- is-extglob 2.1.1CommonJS
- jsesc 3.1.0CommonJS
- vite 8.2.2ESM-only
- dotenv 17.4.2CommonJS