DEV Community

Cover image for Creating a standalone binary with Deno.
Henry Barreto
Henry Barreto

Posted on

Creating a standalone binary with Deno.

In the version 1.6 of Deno runtime come with a new tool, deno compile. This new feature is used to build a completely standalone binary to your script, it means it does not need to have the Deno installed on your PC to run your code.

With the code above, it is possible to try this new feature and it will generate a bin file ready to run.

deno compile --unstable https://deno.land/std@0.80.0/examples/welcome.ts
Enter fullscreen mode Exit fullscreen mode

After that, it just runs the output file

./welcome
Welcome to Deno 🦕
Enter fullscreen mode Exit fullscreen mode

Unfortunately, this feature is not full working, and it has some issues to fix in the future, further information can be found here: https://deno.land/posts/v1.6#codedeno-compilecode-building-self-contained-standalone-binaries

Discussion (0)