mjs2cjs(1)

mjs2cjs1

Mjs2cjs

Usage

mjs2cjs <start_file>

Overview

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

Releases

2 releases since Debian 12 (Bookworm); the text changed 1 time.

  1. 12
  2. 13

From dh-nodejs 0.15.23 in Debian 13 (Trixie). Parsed by carta from the page's man source.