canirequire

canirequireESM-only › get-east-asian-width

Is get-east-asian-width ESM-only? Can you require() it?

Determine the East Asian Width of a Unicode character

Last verified Sep 9, 2026 against get-east-asian-width@1.6.0. JSON

ESM-only ESM-only — it has never shipped a CommonJS build

get-east-asian-width has been ESM-only since its first stable release. There is no version you can require() on Node.js 18 or older.

On Node.js 20.19+, 22.12+ and every newer release, require("get-east-asian-width") works anyway: Node can load synchronous ES modules through require(). Verified on Node 20, 22, 24, 26. Node.js 18 and older still fail with ERR_REQUIRE_ESM.

Latest
1.6.0 (May 8, 2026)
Module format
ESM-only
Last CommonJS version
none
ESM-only since
1.0.0 (Oct 28, 2023)
TypeScript types
Bundled
Node engines
>=18
Weekly downloads
69.3M
License
MIT

Does get-east-asian-width@1.6.0 actually load? Runtime test results

Installed and executed on Sep 9, 2026 with require("get-east-asian-width") from a CommonJS file and import "get-east-asian-width" from an ES module.

Runtimerequire("get-east-asian-width")import "get-east-asian-width"
Node.js 18✗ failsERR_REQUIRE_ESM✓ works
Node.js 20✓ works✓ works
Node.js 22✓ works✓ works
Node.js 24✓ works✓ works
Node.js 26✓ works✓ works
Bun 1.4✓ works✓ works

How to import get-east-asian-width

ES modules (import)

import getEastAsianWidth from "get-east-asian-width";

CommonJS (require)

// Node.js 20.19+ / 22.12+ / newer (package has no top-level await):
const getEastAsianWidth = require("get-east-asian-width");

// Any Node.js version:
const getEastAsianWidth = await import("get-east-asian-width");

Module format by version

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

VersionsFormatFirst published
1.0.0 – 1.6.0ESM-onlyOct 28, 2023

Frequently asked

Is get-east-asian-width ESM-only?

get-east-asian-width@1.6.0 is ESM-only. get-east-asian-width has been ESM-only since its first stable release. There is no version you can require() on Node.js 18 or older.

Which version of get-east-asian-width still supports CommonJS / require()?

None. get-east-asian-width has always been ESM-only. Use import, or await import("get-east-asian-width") from CommonJS.

How do I use get-east-asian-width from a CommonJS file?

Use a dynamic import: const mod = await import("get-east-asian-width"). On Node.js 20.19+, 22.12+ and newer, a plain require("get-east-asian-width") also works for ESM packages that do not use top-level await.

Does get-east-asian-width work in Bun?

Yes. import "get-east-asian-width" loaded successfully in Bun 1.4 on Sep 9, 2026.

Does get-east-asian-width ship TypeScript types?

Yes. get-east-asian-width bundles its own type declarations; no @types package is needed.

Links

Other esm-only packages

Similar popularity