canirequire

canirequireDual (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.

Latest
6.1.0 (May 19, 2026)
Module format
Dual (CommonJS + ESM)
Last CommonJS version
6.1.0
Native ESM since
5.5.0
TypeScript types
Bundled
Node engines
not declared
Weekly downloads
4.6M
License
Apache-2.0

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.

Runtimerequire("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.4pendingpending

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

VersionsFormatFirst published
5.5.0 – 6.1.0Dual (CommonJS + ESM)Feb 18, 2024
3.2.1 – 5.4.3CommonJSJul 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

Similar popularity