BABEL-NODE.JS(1)

✨ NAME ✨

babel-node.js β€” okay bestie, picture the Node.js CLI, right? Now picture it with main character energy. It works exactly the same as the Node.js CLI, except it has the added benefit of compiling with Babel presets and plugins before running it. That's the whole serve. πŸ’…

And yes, this is a section 1 manpage β€” User Commands β€” so you know it's a real command you can just run. 🫢


🌸 SYNOPSIS 🌸

babel-node [options] [ -e script | script.js ] [arguments]

Like, that's it. That's the shape of every invocation. Options first if you want 'em, then either a script via -e or a script.js file, then whatever arguments you're passing through. Simple. Elegant. Ate. πŸ”₯


πŸŽ€ OPTIONS πŸŽ€

  • -e, --eval [script] β€” Evaluate script. You hand it code, it runs the code. No file required. ✨
  • --no-babelrc β€” Specify whether or not to use .babelrc and .babelignore files. Yes, this is the switch that decides if those files get a seat at the table. πŸ¦‹
  • -r, --require [module] β€” Require module. Pulls it in before anything else gets going.
  • -p, --print [code] β€” Evaluate code and print the result. It's giving "just show me the output, bestie." πŸ“
  • -o, --only [globs] β€” A comma-separated list of glob patterns to compile. Only these. Nothing else. Gatekeeping, but make it config. πŸ’…
  • -i, --ignore [globs] β€” A comma-separated list of glob patterns to skip compiling. The opposite vibe of --only, and no, they are not the same flag, don't do that. 😭
  • -x, --extensions [extensions] β€” List of extensions to hook into. The default lineup is [.es6,.js,.es,.jsx,.mjs] β€” yes, all five, that's the squad. πŸ‘‘
  • --config-file [path] β€” Path to the Babel config file to use. Defaults to working directory babel.config.js. So if you say nothing, that's the one it goes looking for. 🌈
  • --env-name [name] β€” The name of the 'env' to use when loading configs and plugins. Defaults to the value of BABEL_ENV, or else NODE_ENV, or else 'development'. Yes, it's a fallback chain β€” three deep. It's got layers. 🧚
  • --root-mode [mode] β€” The project-root resolution mode. One of 'root' (the default), 'upward', or 'upward-optional'. Three choices, pick your fighter. ⭐
  • -w, --plugins [string] β€” the manpage gives no description here, bestie. It literally just says [string] and moves on. No lore provided. πŸ™ˆ
  • -b, --presets [string] β€” same situation fr fr, no description in the docs, just [string]. We report, we don't invent. πŸ’€
  • -V, --version β€” output the version number. Classic. Does exactly what it says. πŸ’œ
  • -h, --help β€” display help for command. Your little escape hatch when the vibes get confusing. πŸŽ€
ngl bestie, if you're ever lost, -h is right there and it will never judge you. 🫢

And that's the whole page! This one comes to you from babel-node.js 7.20.15+ds1+~cs... and it was dated February 2025 β€” so if you're reading this way later, just know the version and the date, okay? mwah, go compile something cute. πŸ’–βœ¨

πŸ“¦ where this page comes from