Deno is asynchronous JavaScript/TypeScript runtime. If you are not sure how and what’s of Deno, here is the links
- How to install Deno on Windows - Deno tutorial for beginners
- How to install Deno on Ubuntu Linux - Deno tutorial for beginners: how to install Deno on Windows
- Deno : next generation Node - About Deno TypeScript Runtime
Create a textfile
Deno API allows developers to write files using writeTextFile() which return a promise. A promise is similar to future in flutter, the result of the job will come in future.
You know that Deno is async by default, in the async world program continue working without interrupting other jobs.
const write = Deno.writeTextFile("./hello.txt", "Hello World!"); write.then(() => console.log("File written to ./hello.txt"));
Here the write constant will return result / only if the operation is succeeded.
To run this script yo may allow deno to use –allow-write permission.
deno run --allow-write maint.ts
All of my Deno projects will be published on my GitHub Repo, so keep watching.