Deno: how to start use it

Deno is a new JavaScript/TypeScript runtime with secure defaults and a great developer experience. It’s built on V8 and Rust.

How to install

You can install Deno using the following command:

curl -fsSL https://deno.land/x/install/install…


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Ian Gabriel Oliveira de Sousa

Deno is a new JavaScript/TypeScript runtime with secure defaults and a great developer experience. It's built on V8 and Rust.

How to install

You can install Deno using the following command:

curl -fsSL https://deno.land/x/install/install.sh | sh

How to use

After installing Deno, you can create a file with the .ts extension and write your code.

After saving the file, you can run the code by typing the following command:

deno run file.ts

How to use a module

You can use a module by typing the following command:

deno run --allow-net https://deno.land/std/examples/welcome.ts

How to use a module in your code

You can use a module in your code by typing the following command:


import { serve } from "https://deno.land/std/http/server.ts";

const s = serve({ port: 8000 });

console.log("http://localhost:8000/");

for await (const req of s) {

req.respond({ body: "Hello World" });

}

How to install a module

You can install a module by typing the following command:

deno install \
--allow-net --allow-read \
--allow-write --allow-env \
--allow-run --unstable \
https://deno.land/x/velociraptor/cli.ts

How to use a package manager in your code

You can use a package manager in your code by typing the following command:

import { vpm } from "https://deno.land/x/vpm/vpm.ts";

await vpm.install("https://deno.land/x/velociraptor/cli.ts");


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Ian Gabriel Oliveira de Sousa


Print Share Comment Cite Upload Translate Updates
APA

Ian Gabriel Oliveira de Sousa | Sciencx (2022-10-16T21:08:51+00:00) Deno: how to start use it. Retrieved from https://www.scien.cx/2022/10/16/deno-how-to-start-use-it/

MLA
" » Deno: how to start use it." Ian Gabriel Oliveira de Sousa | Sciencx - Sunday October 16, 2022, https://www.scien.cx/2022/10/16/deno-how-to-start-use-it/
HARVARD
Ian Gabriel Oliveira de Sousa | Sciencx Sunday October 16, 2022 » Deno: how to start use it., viewed ,<https://www.scien.cx/2022/10/16/deno-how-to-start-use-it/>
VANCOUVER
Ian Gabriel Oliveira de Sousa | Sciencx - » Deno: how to start use it. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/10/16/deno-how-to-start-use-it/
CHICAGO
" » Deno: how to start use it." Ian Gabriel Oliveira de Sousa | Sciencx - Accessed . https://www.scien.cx/2022/10/16/deno-how-to-start-use-it/
IEEE
" » Deno: how to start use it." Ian Gabriel Oliveira de Sousa | Sciencx [Online]. Available: https://www.scien.cx/2022/10/16/deno-how-to-start-use-it/. [Accessed: ]
rf:citation
» Deno: how to start use it | Ian Gabriel Oliveira de Sousa | Sciencx | https://www.scien.cx/2022/10/16/deno-how-to-start-use-it/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.