canirequire

canirequireDual (CommonJS + ESM) › @emnapi/runtime

Is @emnapi/runtime ESM-only? Can you require() it?

emnapi runtime

Last verified Sep 9, 2026 against @emnapi/runtime@1.11.3. JSON

Dual (CommonJS + ESM) Dual package — both require() and import work

@emnapi/runtime publishes both a CommonJS entry and a native ESM entry (ESM added in 0.31.0). require("@emnapi/runtime") and import "@emnapi/runtime" both work on every supported Node.js version and in Bun.

Latest
1.11.3 (Jul 25, 2026)
Module format
Dual (CommonJS + ESM)
Last CommonJS version
1.11.3
Native ESM since
0.31.0
TypeScript types
Bundled
Node engines
not declared
Weekly downloads
72.8M
License
MIT

Does @emnapi/runtime@1.11.3 actually load? Runtime test results

Installed and executed on Sep 9, 2026 with require("@emnapi/runtime") from a CommonJS file and import "@emnapi/runtime" from an ES module.

Runtimerequire("@emnapi/runtime")import "@emnapi/runtime"
Node.js 18✓ works✓ 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 @emnapi/runtime

ES modules (import)

import runtime from "@emnapi/runtime";

CommonJS (require)

const runtime = require("@emnapi/runtime");

Module format by version

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

VersionsFormatFirst published
0.31.0 – 1.11.3Dual (CommonJS + ESM)Feb 14, 2023

Frequently asked

Is @emnapi/runtime ESM-only?

@emnapi/runtime@1.11.3 ships CommonJS and ESM builds. @emnapi/runtime publishes both a CommonJS entry and a native ESM entry (ESM added in 0.31.0). require("@emnapi/runtime") and import "@emnapi/runtime" both work on every supported Node.js version and in Bun.

Can I require @emnapi/runtime?

Yes. @emnapi/runtime ships a CommonJS entry, so require("@emnapi/runtime") works on every Node.js version, alongside the native ESM entry for import.

Does @emnapi/runtime work in Bun?

Yes. import "@emnapi/runtime" loaded successfully in Bun 1.4 on Sep 9, 2026.

Does @emnapi/runtime ship TypeScript types?

Yes. @emnapi/runtime bundles its own type declarations; no @types package is needed.

Links

Other dual (commonjs + esm) packages

Similar popularity