Whats the difference beetween deno install and deno compile?
Asked Answered
S

1

6

If I do deno --help it shows:

  • compile = Compile the script into a self-contained executable
  • install = Install script as an executable

What's the difference between these two commands?

Sinuosity answered 14/1, 2021 at 7:38 Comment(0)
E
10
Command Output Self contained 1 Deno runtime integrated 2
compile binary y y
install script (shell / .bat) n n
bundle .js y n
1 self contained := includes local and remote dependencies / scripts, single file

2 integrated := no separate runtime is needed

Electrotype answered 14/1, 2021 at 9:43 Comment(3)
So if I want to create a script executable for others to use I would want to use compile right?Sinuosity
It depends - the compiled sources are considerably larger than the pure script file with bundle (devs intend to work on reducing the binary size in later revisions). So if the script size doesn't matter / the client does not have a deno runtime / you want to ensure a certain version / it should be executed as simple as possible / code "transparency" is not important for the client, take compile, otherwise bundle.Electrotype
When I install a TS/JS script will deno also move my script to the same location as the output shell / batch or even embed the TS/JS script into it?Paradrop

© 2022 - 2024 — McMap. All rights reserved.