MJS2CJS(1)
π MJS2CJS β the manual page, but make it slay π
okay bestie, sit down, hydrate, and let me tell you about mjs2cjs β it's a little user command and it's honestly lowkey iconic. β¨
πΈ NAME πΈ
mjs2cjs β no cap, that's literally the name. mjs2cjs. That's it. That's the name. π
π SYNOPSIS π
mjs2cjs <start_file>
π¦ DESCRIPTION π¦
so here's the tea: mjs2cjs uses a generic rollup.config.mjs to generate a commonjs file in the dist subdirectory. fr fr, that's the whole job. π«Ά
and where does the output name come from? bestie it's extracted from package.json β specifically the "main" field β and if that's not there, it falls back to index.cjs. simple as. π
β¨ OPTIONS β¨
-bβ ("bundle") π« build a bundle file-oβ ("out") π outfile-aβ ("auto") π€ automatically transform a"type:module"package into a mix of cjs/mjs
π a note about the -a option (read this one, bestie) π
ngl this one is doing the most, and you need to know what it's doing:
- it does not only build the commonjs file β it also modifies
package.json. the audacity, honestly. π - and if a
debian/index.cjsexists, it gets installed and used in the"package.json"->exports->requirefield. this lets you write a wrapper when the API changes. very main character of it. π - option
-ais usable if and only if the module is a pure ES module β aka it's declared astype:moduleinpackage.json. if it's not, it's a no. periodt. β
π COPYRIGHT π
- Copyright Β© Yadd
<yadd@debian.org>π«Ά - Licensed under GPL-2+ (see
/usr/share/common-licenses/GPL-2)
reminder bestie:-aliterally rewrites yourpackage.json, so know what you're signing up for before you send it. iykyk. π
and that's the whole page, angel! this was mjs2cjs 0.17.8, dated August 2026 β go forth and convert your modules, you absolute legend. πβ¨ππ¦πΈπ π«Άπ₯πβπ
π¦ where this page comes from
- ubuntu stonking: dh-nodejs 0.17.8 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms