new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Deno · Reference · all subjects

cli commands/transpile

15 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

deno transpile command syntax

The deno transpile command emits JavaScript from TypeScript, JSX, or TSX sources. The syntax is: deno transpile <files...> [flags]. The <files> parameter is one or more source file paths; globs are expanded by the shell. deno transpile does not crawl a directory — you must pass the specific files you want transpiled, optionally via a shell glob.

deno transpile output modes

deno transpile supports three output modes: (1) no output flag writes transpiled output to standard out; (2) -o <path> or --output <path> writes output to a single file and conflicts with --outdir; (3) --outdir <dir> writes each input file into <dir>, mirroring the source layout.

deno transpile input/output extension mapping

Input .ts files produce .js output with .js.map source maps. Input .tsx files produce .js output with .js.map source maps. Input .jsx files produce .js output with .js.map source maps. Input .mts files produce .mjs output with .mjs.map source maps. Input .cts files produce .cjs output with .cjs.map source maps.

deno transpile --source-map flag

The --source-map flag accepts three modes: 'none' (default, no source map); 'inline' (embed the source map as a data: comment in each file); 'separate' (write a sibling .js.map, .mjs.map, or .cjs.map file). When writing to stdout, only inline source maps work; separate requires an output path to write the map next to.

deno transpile --declaration flag

Use --declaration to emit .d.ts declaration files. Declarations are produced by the bundled TypeScript compiler and honor compilerOptions from deno.json or tsconfig.json. .d.ts files are always written to disk — next to the source when no output location is set, or into --outdir when one is supplied — even if JavaScript output is going to stdout or a single -o file.

deno transpile uses deno.json compiler options

JSX transform, decorators, target, and other emit settings in deno transpile come from compilerOptions in deno.json (or tsconfig.json), so the output matches what deno run would execute.

deno transpile vs tsc differences

deno transpile performs emit only with no type checking; use deno check separately for type errors. tsc performs full type checking by default. deno transpile generates .d.ts files with --declaration using bundled tsc. tsc does the same without a flag. deno transpile resolves JSR, npm, and remote imports; tsc does not. deno transpile reads config from deno.json or tsconfig.json; tsc reads tsconfig.json only. deno transpile uses fast SWC-based emit; tsc is slower due to type-checking.

deno transpile caveats

deno transpile does not bundle — each input file produces one output file with imports rewritten extension-only (e.g., ./foo.ts → ./foo.js), and the resulting graph requires a runtime that resolves imports. For single-file output, use deno bundle. deno transpile does not crawl directories — pass files explicitly or via glob. --source-map inline works when writing to stdout; separate requires an output path.

when to use deno transpile

Use deno transpile when shipping a library to consumers that run node or a browser bundler directly, when a downstream tool only understands .js files, or when you want pre-compiled .js checked into a build artifact rather than transpiled on the fly. For most workflows, deno run, deno test, and deno serve already accept .ts and .tsx files directly.

deno transpile example: output to stdout

deno transpile main.ts

deno transpile example: write to single file

deno transpile main.ts -o dist/main.js

deno transpile example: multiple files to output directory

deno transpile src/main.ts src/helpers.ts --outdir dist

deno transpile example: shell glob to output directory

deno transpile src/*.ts --outdir dist

deno transpile example: separate source map

deno transpile main.ts -o dist/main.js --source-map separate

deno transpile example: emit declaration files

deno transpile src/*.ts --outdir dist --declaration

Give your agent this brain