canirequire › Dual (CommonJS + ESM) › echarts
Is echarts ESM-only? Can you require() it?
Apache ECharts is a powerful, interactive charting and data visualization library for browser
Latest version 6.1.0, published May 19, 2026. JSON
Dual (CommonJS + ESM) Dual package — both require() and import work
echarts publishes both a CommonJS entry and a native ESM entry (ESM added in 5.5.0). require("echarts") and import "echarts" both work on every supported Node.js version and in Bun.
Does echarts@6.1.0 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.
| Runtime | require("echarts") | import "echarts" |
|---|---|---|
| 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.4 | pending | pending |
Install failed in our sandbox: PROBE_TIMEOUT The rows above show what package.json declares.
How to import echarts
ES modules (import)
import echarts from "echarts";CommonJS (require)
const echarts = require("echarts");Module format by version
Derived from the type, main and exports fields of every stable release on npm (74 versions; the newest 60 shown).
| Versions | Format | First published |
|---|---|---|
| 5.5.0 – 6.1.0 | Dual (CommonJS + ESM) | Feb 18, 2024 |
| 3.2.1 – 5.4.3 | CommonJS | Jul 4, 2016 |
Frequently asked
Is echarts ESM-only?
echarts@6.1.0 ships CommonJS and ESM builds. echarts publishes both a CommonJS entry and a native ESM entry (ESM added in 5.5.0). require("echarts") and import "echarts" both work on every supported Node.js version and in Bun.
Can I require echarts?
Yes. echarts ships a CommonJS entry, so require("echarts") works on every Node.js version, alongside the native ESM entry for import.
Does echarts ship TypeScript types?
Yes. echarts 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
- eslint-plugin-simple-import-sort 14.0.0CommonJS
- jasmine-core 7.0.2CommonJS
- react-dnd 16.0.1ESM-only
- nock 14.0.17CommonJS
- eslint-plugin-promise 7.3.0CommonJS
- stylelint-scss 7.2.0ESM-only
- eslint-plugin-vue 10.11.0CommonJS
- typedoc 0.28.20No entry