.js, .mjs,
.cjs, and TypeScript (.ts, .mts, .cts, .tsx) directly — no build step,
no ts-node, no loader flags.
meow run
meow run <target> does one of two things, in this order:
- If
<target>matches a script in yourpackage.json, it runs that script (withpre/postlifecycle hooks — see below). - Otherwise it treats
<target>as a file path, resolves it, and drives that module through the runtime.
Forwarding arguments
Pass arguments to your program after--:
-- is forwarded verbatim as the program’s argv.
meow dev
meow dev is shorthand for meow run dev. It prints a cold-start banner with your
project mode and the time-to-first-byte, then runs the dev script:
meow task
meow task <name> runs a package.json script by name, using the same resolution
as meow run. It’s the explicit form when a script name might collide with a
file path.
The omni-router
meow leans on muscle memory. When the first argument isn’t a known subcommand, the omni-router infers your intent so you rarely need to typerun or x:
| You type | Becomes | Rule |
|---|---|---|
meow build | meow run build | a standard script name (build, start, dev, lint, test, preview, serve, …) |
meow ./app.ts | meow run ./app.ts | a path, or a .js/.ts/.json/... file |
meow /abs/server.js | meow run /abs/server.js | an absolute path |
meow create-vite app | meow x create-vite app | unknown name → ephemeral package |
meow -e "..." | eval mode | -e/--eval/-p/--print |
- Competitor flags are stripped before parsing:
--shell <value>,--silent,--no-warnings, and redundant inner package-manager calls (bun run bun build→bun run build). - Deno-style run flags are stripped:
-A,--allow-all,--unstable,--unstable-*are accepted and ignored, so scripts copied from Deno don’t crash.
package.json scripts
When you run a script, meow plans how to execute it intelligently rather than always spawning a shell:Native fast path
If the script is a simple command whose target resolves to a local file or a
dependency’s
bin (e.g. node ./build.cjs, tsc, vite), meow runs it
directly in the runtime — no shell process.Lifecycle hooks
pre<name> and post<name> scripts run automatically around <name>, npm-style.
A non-zero exit from a pre hook stops the chain.
package.json
INIT_CWD, npm_lifecycle_event, npm_lifecycle_script, and npm_package_json.
Eval & print
Run inline source without a file:-p / --print wraps your expression in console.log(...). (These map to the
internal node-eval mode; an interactive REPL is not provided.)
Exit codes
meow propagates your program’s exit code to the shell.process.exit(n) and a
natural completion both surface correctly (codes are taken modulo 256, like a
normal process):
V8 tuning
Two escape hatches pass straight through to the engine:--max-old-space-size is also read from NODE_OPTIONS if present, for drop-in
compatibility.
Next: TypeScript support
How meow runs
.ts directly, and the one place it diverges from Node’s ESM resolution.