DEV Community

Ian Gabriel Oliveira de Sousa
Ian Gabriel Oliveira de Sousa

Posted on

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.sh | sh

Enter fullscreen mode Exit fullscreen mode

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

Enter fullscreen mode Exit fullscreen mode

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

Enter fullscreen mode Exit fullscreen mode

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" });

}
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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");

Enter fullscreen mode Exit fullscreen mode

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay