What is Deno
Deno is a simple, modern and secure runtime for JavaScript and TypeScript that uses V8 and is built in Rust. - https://deno.land/
Install deno (MacOS, Linux)
More options are here
Simple example
From terminal
File Server example
If you skip these options (--allow-net --allow-read
), You will encounter an error.
Write File example
TextEncoder is an Wep API which generate a byte stream with UTF-8 encoding.
WriteFile returns promise
Await don't have to be in a Async function because Deno handles this.
Execute above with deno
Install
deno install {script}
Install script as an executable.
Uninstall
VSCode Extensions
[Issue] When the exclamation point is displayed in the lower right deno icon, restart vscode.
https://github.com/denoland/vscode_deno
You can also find more examples from my repo: https://github.com/Parkseokje/deno-playground
Reference site
Last updated