# @chialab/cjs-to-esm

> A commonjs to esm converter.

Latest version **0.19.2** (published 2026-05-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @chialab/cjs-to-esm
pnpm add @chialab/cjs-to-esm
yarn add @chialab/cjs-to-esm
bun add @chialab/cjs-to-esm
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.19.2 |
| Published | 2026-05-28 |
| First published | 2021-05-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18 |
| Dependencies | 1 |
| Unpacked size | 20.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 183 |
| Author | Chialab |
| Maintainers | chialab-admin, chialab-developers |
| Keywords | commonjs, esm |

## Links

- npm: https://www.npmjs.com/package/@chialab/cjs-to-esm
- Repository: https://github.com/chialab/rna
- Homepage: https://github.com/chialab/rna#readme
- Issues: https://github.com/chialab/rna/issues
- npm.io page: https://npm.io/package/@chialab/cjs-to-esm

## Dependencies (1)

- [@chialab/estransform](https://npm.io/package/@chialab/estransform.md) ^0.20.0

## Recent versions

- 0.19.2 (latest) — 2026-05-28
- 0.19.0-beta.2 (beta) — 2024-11-04
- 0.18.0-alpha.1 (alpha) — 2023-08-29
- 0.19.1 — 2026-02-25
- 0.19.0 — 2025-08-25
- 0.19.0-beta.0 — 2024-03-11
- 0.18.0 — 2024-01-11
- 0.17.11 — 2023-05-26
- 0.17.10 — 2023-05-17
- 0.17.9 — 2023-05-17
- 0.17.8 — 2023-05-12
- 0.17.7 — 2023-05-09
- 0.18.0-alpha.0 — 2023-05-01
- 0.17.6 — 2022-10-19
- 0.17.5 — 2022-10-06
- … 67 more at https://npm.io/package/@chialab/cjs-to-esm/versions

## README

# CommonJS to ESM

A commonjs to esm converter, inspired by [WMR](https://github.com/preactjs/wmr).

[![NPM](https://img.shields.io/npm/v/@chialab/cjs-to-esm.svg)](https://www.npmjs.com/package/@chialab/cjs-to-esm)

## Install

```sh
npm i @chialab/cjs-to-esm -D
```

```sh
yarn add @chialab/cjs-to-esm -D
```

```sh
pnpm add @chialab/cjs-to-esm -D
```

## Usage

```js
import { transform } from '@chialab/cjs-to-esm';

const { code, map } = transform('require("tslib"); module.exports = function() {}');
```

## License

**CommonJS to ESM** is released under the [MIT](https://github.com/chialab/rna/blob/main/packages/cjs-to-esm/LICENSE) license.

---
_Source: https://npm.io/package/@chialab/cjs-to-esm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
