---
name: "mjs2cjs"
section: "1"
platform: "linux"
package: "dh-nodejs"
version: "0.15.23"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mjs2cjs"
---

# mjs2cjs(1)

mjs2cjs

## NAME

mjs2cjs - mjs2cjs

## SYNOPSIS

**mjs2cjs** *\<start\_file\>*

## DESCRIPTION

mjs2cjs uses a generic rollup.config.mjs to generate a commonjs file in dist subdirectory.

Output name is extracted from package.json (field "main") or fallback to index.cjs

## OPTIONS

**-b** ("bundle"): build a bundle file

**-o** ("out"): outfile

**-a** ("auto"): automatically transform "type:module" package into mix cjs/mjs

Note for "-a" option: This option not only build commonjs file but also modify package.json. And if a debian/index.cjs exists, it is installed and used in "package.json-\>exports-\>require" field. This permits one to write a wrapper when API change. Option "-a" is usable if and only if module is a pure ES module (declared as type:module in package.json).

## COPYRIGHT

Copyright © Yadd \<yadd@debian.org\>

Licensed under GPL-2+ (see */usr/share/common-licenses/GPL-2*)
