Catullus
raw JSON → 2.0.0 verified Fri May 01 auth: no javascript maintenance
Catullus is a transpiler that compiles modern JavaScript syntax to compatible versions for older environments. It acts as a wrapper around Babel and presets to simplify build configuration. The current stable version is 2.0.0, with no active release cadence apparent from the metadata. Key differentiators: it provides a CLI command (catullus babel) and integrates with .babelrc. Compared to plain Babel, Catullus aims to reduce boilerplate but enters a space already well-covered by higher-level tools like Parcel or Webpack. The project appears unmaintained with sparse documentation and limited community adoption.
Common errors
error Error: Cannot find module 'babel-preset-env' ↓
cause Missing required Babel 6 dependency; Catullus expects these old packages.
fix
Install old Babel presets: npm install babel-preset-env babel-preset-react babel-preset-stage-2
error Error: Command failed: catullus babel src --out-dir lib/ ↓
cause Missing .babelrc or invalid syntax in the configuration file.
fix
Create a valid .babelrc file in the project root.
error Error: The 'babel' subcommand was not recognized. ↓
cause Catullus requires 'babel' as a subcommand; calling 'catullus src' fails.
fix
Use 'catullus babel src' instead.
Warnings
deprecated Catullus relies on deprecated Babel 6 packages (e.g., babel-preset-env, babel-plugin-add-module-exports). ↓
fix Use Babel 7+ directly: replace with @babel/preset-env and update plugins.
gotcha Catullus only processes .js files; other extensions are ignored. ↓
fix For non-JS files (e.g., .jsx, .ts), use Webpack or another bundler.
gotcha The command must include 'babel' subcommand (e.g., `catullus babel src`). ↓
fix Use `catullus babel` instead of just `catullus`.
breaking Potential breaking change if moving from Babel 6 to Babel 7; Catullus is locked to Babel 6 presets. ↓
fix Migrate to @babel/preset-env (Babel 7) directly; Catullus may not support it.
Install
npm install catullus yarn add catullus pnpm add catullus Imports
- default (command line) wrong
npx catulluscorrectcatullus babel src --out-dir lib/ - .babelrc wrong
Using a different configuration file like babel.config.jscorrectCreate a .babelrc file with presets and plugins. - script in package.json wrong
"build": "catullus src --out-dir lib/"correct"build": "catullus babel src --out-dir lib/"
Quickstart
npm install --save-dev catullus
# Create .babelrc:
echo '{"presets":[["env",{"targets":{"node":"6.9"}}]],"plugins":["transform-object-rest-spread"]}' > .babelrc
# Add build script to package.json:
# "build": "catullus babel src --out-dir lib/"
# Then run:
npm run build