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

> @swc/helpers@0.5.23 ships CommonJS and ESM builds. Dual package — require() works on every Node.js version we test; import works too.

External helpers for the swc project.

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

@swc/helpers publishes both a CommonJS entry and a native ESM entry (ESM added in 0.4.15). require("@swc/helpers") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. import "@swc/helpers" works alongside it.

## What to do

1. Nothing to change. require("@swc/helpers") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. import * as helpers from "@swc/helpers" works alongside it; use named imports for what the ESM entry exports.
2. TypeScript: no types are available for @swc/helpers; declare the module yourself if you need them.

## Facts

- 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
- Weekly downloads: 79.4M
- License: Apache-2.0

## Runtime test results for @swc/helpers@0.5.23

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

| Runtime | require("@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.0 | works | works |

## How to import @swc/helpers

ES modules:

```js
import * as helpers from "@swc/helpers";
```

Namespace import shown because the ESM entry may have no default export; use named imports for what it exports.

CommonJS:

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

| Versions | Format | First published |
|---|---|---|
| 0.4.15 – 0.5.23 | Dual (CommonJS + ESM) | Aug 17, 2023 |
| 0.3.6 – 0.4.14 | CommonJS | Feb 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") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. import "@swc/helpers" works alongside it.

**Can I require @swc/helpers?**

Yes. @swc/helpers ships a CommonJS entry alongside the native ESM entry. require("@swc/helpers") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun.

**Does @swc/helpers work in Bun?**

Yes. import "@swc/helpers" loaded successfully in Bun 1.4.0 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

- [@swc/helpers on npm](https://www.npmjs.com/package/@swc/helpers)
- [Source repository](https://github.com/swc-project/swc)
- [HTML version](https://canirequire.com/package/@swc/helpers/)
- [JSON version](https://canirequire.com/package/@swc/helpers.json)

---

For scripts and AI agents: any package is at https://canirequire.com/package/<name>/index.md (Markdown) or https://canirequire.com/package/<name>.json (JSON); the site index is https://canirequire.com/llms.txt. Fetch the URL directly; no search needed.
