canirequire

canirequireDual (CommonJS + ESM) › @swc/helpers

Is @swc/helpers ESM-only? Can you require() it?

External helpers for the swc project.

Last verified Sep 9, 2026 against @swc/helpers@0.5.23. JSON

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

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

Latest
0.5.23 (May 27, 2026)
Module format
Dual (CommonJS + ESM)
Last CommonJS version
0.5.23
Native ESM since
0.4.15
TypeScript types
None
Node engines
not declared
License
Apache-2.0

Does @swc/helpers@0.5.23 actually load? Runtime test results

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

Runtimerequire("@swc/helpers")import "@swc/helpers"
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 @swc/helpers

ES modules (import)

import helpers from "@swc/helpers";

CommonJS (require)

const helpers = require("@swc/helpers");

Module format by version

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

VersionsFormatFirst published
0.4.15 – 0.5.23Dual (CommonJS + ESM)Aug 17, 2023
0.3.6 – 0.4.14CommonJSFeb 27, 2022

Frequently asked

Is @swc/helpers ESM-only?

@swc/helpers@0.5.23 ships CommonJS and ESM builds. @swc/helpers publishes both a CommonJS entry and a native ESM entry (ESM added in 0.4.15). require("@swc/helpers") and import "@swc/helpers" both work on every supported Node.js version and in Bun.

Can I require @swc/helpers?

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

Does @swc/helpers work in Bun?

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

Does @swc/helpers ship TypeScript types?

No. @swc/helpers ships no type declarations and there is no @types package for it.

Links

Other dual (commonjs + esm) packages

Similar popularity