2

I'm learning Typescript using Deno and wanted do see javaScript result. Is there some command line I didn't see on docs?

ps.: I Know there's no compiling step using Deno, but at some point it must have a Javascript code so V8 engine can run it.

1 Answer 1

6

The transpiled code will be stored in

$DENO_DIR/gen

$DENO_DIR varies depending on the OS

  • On Linux/Redox: $XDG_CACHE_HOME/deno or $HOME/.cache/deno
  • On Windows: %LOCALAPPDATA%/deno (%LOCALAPPDATA% = FOLDERID_LocalAppData)
  • On macOS: $HOME/Library/Caches/deno If something fails, it falls back to $HOME/.deno

You can check the location doing:

deno info

Which will output:

DENO_DIR location: "/home/user/.cache/deno"
Remote modules cache: "/home/user/.cache/deno/deps"
TypeScript compiler cache: "/home/user/.cache/deno/gen"

If you do the following import:

import { serve } from 'https://deno.land/[email protected]/http/server.ts'

You'll see the transpiled JavaScript code in:

$DENO_DIR/gen/https/deno.land/[email protected]/http

Doing:

ls $DENO_DIR/gen/https/deno.land/[email protected]/http

You'll see:

http_status.ts.js
http_status.ts.js.map
http_status.ts.meta
_io.ts.js
_io.ts.js.map
_io.ts.meta
server.ts.js
server.ts.js.map
server.ts.meta
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.