improve docs (#5872)

This commit is contained in:
Robin Wieruch 2020-05-26 16:08:23 +02:00 committed by GitHub
parent 228f9c207f
commit 44477596ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 15 deletions

View file

@ -1,7 +1,7 @@
## TCP echo server ## TCP echo server
This is an example of a simple server which accepts connections on port 8080, This is an example of a server which accepts connections on port 8080, and
and returns to the client anything it sends. returns to the client anything it sends.
```ts ```ts
const listener = Deno.listen({ port: 8080 }); const listener = Deno.listen({ port: 8080 });

View file

@ -4,7 +4,7 @@ In this chapter we'll discuss:
- Installing Deno - Installing Deno
- Setting up your environment - Setting up your environment
- Running a simple `Hello World` script - Running a `Hello World` script
- Writing our own script - Writing our own script
- Understanding permissions - Understanding permissions
- Using Deno with TypeScript - Using Deno with TypeScript

View file

@ -1,7 +1,6 @@
## First steps ## First steps
This page contains some simple examples to teach you about the fundamentals of This page contains some examples to teach you about the fundamentals of Deno.
Deno.
This document assumes that you have some prior knowledge of JavaScript, This document assumes that you have some prior knowledge of JavaScript,
especially about `async`/`await`. If you have no prior knowledge of JavaScript, especially about `async`/`await`. If you have no prior knowledge of JavaScript,
@ -14,8 +13,8 @@ before attempting to start with Deno.
Deno is a runtime for JavaScript/TypeScript which tries to be web compatible and Deno is a runtime for JavaScript/TypeScript which tries to be web compatible and
use modern features wherever possible. use modern features wherever possible.
Browser compatibility means a simple `Hello World` program in Deno is the same Browser compatibility means a `Hello World` program in Deno is the same as the
as the one you can run in the browser: one you can run in the browser:
```ts ```ts
console.log("Welcome to Deno 🦕"); console.log("Welcome to Deno 🦕");
@ -106,10 +105,10 @@ Try the program:
deno run --allow-read https://deno.land/std/examples/cat.ts /etc/passwd deno run --allow-read https://deno.land/std/examples/cat.ts /etc/passwd
``` ```
### A simple TCP server ### TCP server
This is an example of a simple server which accepts connections on port 8080, This is an example of a server which accepts connections on port 8080, and
and returns to the client anything it sends. returns to the client anything it sends.
```ts ```ts
const hostname = "0.0.0.0"; const hostname = "0.0.0.0";

View file

@ -52,7 +52,7 @@ const [diagnostics, emitMap] = await Deno.compile(
); );
``` ```
In this case `emitMap` will contain a simple `console.log()` statement. In this case `emitMap` will contain a `console.log()` statement.
### `Deno.bundle()` ### `Deno.bundle()`

View file

@ -14,9 +14,9 @@ first line of code.
### Chrome Devtools ### Chrome Devtools
Let's try debugging simple program using Chrome Devtools; for this purpose we'll Let's try debugging a program using Chrome Devtools; for this purpose we'll use
use [file_server.ts](https://deno.land/std@v0.50.0/http/file_server.ts) from [file_server.ts](https://deno.land/std@v0.50.0/http/file_server.ts) from `std`;
`std`; a simple static file server. a static file server.
Use `--inspect-brk` flag to break execution on the first line. Use `--inspect-brk` flag to break execution on the first line.
@ -83,7 +83,7 @@ Deno can be debugged using VSCode.
Official support in plugin is being worked on - Official support in plugin is being worked on -
https://github.com/denoland/vscode_deno/issues/12 https://github.com/denoland/vscode_deno/issues/12
We can still attach debugger by manually providing simple `launch.json` config: We can still attach debugger by manually providing a `launch.json` config:
```json ```json
{ {