Can I transpile TypeScript Code to JavaScript Code with Deno like Bun

Hey I have 10/15 typescript files. SO can i transpile it into javascript code?
9 Replies
Deno AI Helper
Deno AI Helperβ€’6mo ago
Yes, you can transpile TypeScript code to JavaScript using Deno. Deno has built-in support for TypeScript and handles the transpilation automatically. When you run or import TypeScript files, Deno will compile them just-in-time into JavaScript. If you want to transpile TypeScript files and save the resulting JavaScript, you can use the deno compile command. This command will compile your TypeScript code into a standalone executable, but if you're looking to get the JavaScript output, you can use the deno bundle command to bundle your code into a single JavaScript file. Here's an example of how you might use deno bundle:
deno bundle input.ts output.js
deno bundle input.ts output.js
This command will take your input.ts TypeScript file and bundle it into a single output.js JavaScript file. You can do this for each of your TypeScript files. Just replace input.ts with the path to your TypeScript file and output.js with the desired output filename for the JavaScript code. Remember, Deno handles TypeScript out-of-the-box without any additional configuration, making it straightforward to work with TypeScript files. πŸ¦•
arrow
arrowβ€’6mo ago
deno bundle is deprecated and will be removed in 2.0. Best to use esbuild and https://jsr.io/@luca/esbuild-deno-loader
JSR
@luca/esbuild-deno-loader - JSR
@luca/esbuild-deno-loader on JSR: Deno module resolution for esbuild
crowlKats
crowlKatsβ€’6mo ago
esbuild is a more expansive and fleshed out solution than deno bundle. Also deno bundle gave the impression to people that they could bundle for the web, which is not true, as it would just bundle all the files in module graph into a single file to be consumed, as mainly for distributive purpouses.
πŸŽ€π”Έβ„•π”Ύπ”Όπ•ƒ π”»π•†π•ƒπ•ƒπ”½π”Έβ„‚π”ΌπŸŽ€πŸ‡΅πŸ‡Έ
Makes senseπŸ€” Did you see the messages in general? This transphobe was makin me anxious
crowlKats
crowlKatsβ€’6mo ago
yes, apologies about that, tried to reach out directly via DMs but since you have DMs closed, I wasnt able to. A stern one-time warning was given, and if anything like that happens again, let me know instantly and I will take care of it.
πŸŽ€π”Έβ„•π”Ύπ”Όπ•ƒ π”»π•†π•ƒπ•ƒπ”½π”Έβ„‚π”ΌπŸŽ€πŸ‡΅πŸ‡Έ
Thank you.❣️ Like I know I'm not exactly conventional and I try to be low-key but then this happens. Anyway, just an fyi. Thank you very much for always being so kind.
crowlKats
crowlKatsβ€’6mo ago
no problem, and we do adhere to the rust code of conduct, so dont worry I know some other team members might have banned that person instantly, but i am of the opinion people should be given a second chance, even if very unlikely to be effective
πŸŽ€π”Έβ„•π”Ύπ”Όπ•ƒ π”»π•†π•ƒπ•ƒπ”½π”Έβ„‚π”ΌπŸŽ€πŸ‡΅πŸ‡Έ
That certainly seems fair! I know you do, had a look today. Did you get my friend request? #off-topic πŸ€¦πŸ½β€β™€οΈ