mirror of
https://github.com/denoland/deno.git
synced 2024-12-01 16:51:13 -05:00
doc: end sentences with a period in examples (#7722)
This commit is contained in:
parent
eaba9adb03
commit
d2fde8a363
13 changed files with 36 additions and 36 deletions
|
@ -5,8 +5,8 @@
|
||||||
- Like browsers, Deno implements web standard APIs such as
|
- Like browsers, Deno implements web standard APIs such as
|
||||||
[fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).
|
[fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).
|
||||||
- Deno is secure by default, meaning explicit permission must be granted to
|
- Deno is secure by default, meaning explicit permission must be granted to
|
||||||
access the network
|
access the network.
|
||||||
- See also: Deno's [permissions](../getting_started/permissions.md) model
|
- See also: Deno's [permissions](../getting_started/permissions.md) model.
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
|
|
||||||
- Use the Deno standard library
|
- Use the Deno standard library
|
||||||
[file_server.ts](https://deno.land/std@$STD_VERSION/http/file_server.ts) to
|
[file_server.ts](https://deno.land/std@$STD_VERSION/http/file_server.ts) to
|
||||||
run your own file server and access your files from your web browser
|
run your own file server and access your files from your web browser.
|
||||||
- Run [Deno install](../tools/script_installer.md) to install the file server
|
- Run [Deno install](../tools/script_installer.md) to install the file server
|
||||||
locally
|
locally.
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
## Concepts
|
## Concepts
|
||||||
|
|
||||||
- Use [Deno.watchFs](https://doc.deno.land/builtin/stable#Deno.watchFs) to watch
|
- Use [Deno.watchFs](https://doc.deno.land/builtin/stable#Deno.watchFs) to watch
|
||||||
for file system events
|
for file system events.
|
||||||
- Results may vary between operating systems
|
- Results may vary between operating systems.
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
## Concepts
|
## Concepts
|
||||||
|
|
||||||
- Deno can run JavaScript or TypeScript out of the box with no additional tools
|
- Deno can run JavaScript or TypeScript out of the box with no additional tools
|
||||||
or config required
|
or config required.
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
## Concepts
|
## Concepts
|
||||||
|
|
||||||
- Use the std library [http module](https://deno.land/std@$STD_VERSION/http) to
|
- Use the std library [http module](https://deno.land/std@$STD_VERSION/http) to
|
||||||
run your own web server
|
run your own web server.
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ over the response status, request headers and more.
|
||||||
|
|
||||||
## Sample web server
|
## Sample web server
|
||||||
|
|
||||||
In this example, the user-agent of the client is returned to the client
|
In this example, the user-agent of the client is returned to the client:
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
- [import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import)
|
- [import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import)
|
||||||
allows you to include and use modules held elsewhere, on your local file
|
allows you to include and use modules held elsewhere, on your local file
|
||||||
system or remotely.
|
system or remotely.
|
||||||
- Imports are URLs or file system paths
|
- Imports are URLs or file system paths.
|
||||||
- [export](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export)
|
- [export](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export)
|
||||||
allows you to specify which parts of your module are accessible to users who
|
allows you to specify which parts of your module are accessible to users who
|
||||||
import your module
|
import your module.
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
## Concepts
|
## Concepts
|
||||||
|
|
||||||
- Deno uses URLs for dependency management
|
- Deno uses URLs for dependency management.
|
||||||
- One convention places all these dependent URLs into a local `deps.ts` file.
|
- One convention places all these dependent URLs into a local `deps.ts` file.
|
||||||
Functionality is then exported out of `deps.ts` for use by local modules.
|
Functionality is then exported out of `deps.ts` for use by local modules.
|
||||||
- Continuing this convention, dev only dependencies can be kept in a
|
- Continuing this convention, dev only dependencies can be kept in a
|
||||||
|
|
|
@ -3,22 +3,22 @@
|
||||||
## Concepts
|
## Concepts
|
||||||
|
|
||||||
- [import.meta](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import.meta)
|
- [import.meta](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import.meta)
|
||||||
can provide information on the context of the module
|
can provide information on the context of the module.
|
||||||
- The boolean
|
- The boolean
|
||||||
[import.meta.main](https://doc.deno.land/builtin/stable#ImportMeta) will let
|
[import.meta.main](https://doc.deno.land/builtin/stable#ImportMeta) will let
|
||||||
you know if the current module is the program entry point
|
you know if the current module is the program entry point.
|
||||||
- The string [import.meta.url](https://doc.deno.land/builtin/stable#ImportMeta)
|
- The string [import.meta.url](https://doc.deno.land/builtin/stable#ImportMeta)
|
||||||
will give you the URL of the current module
|
will give you the URL of the current module.
|
||||||
- The string
|
- The string
|
||||||
[Deno.mainModule](https://doc.deno.land/builtin/stable#Deno.mainModule) will
|
[Deno.mainModule](https://doc.deno.land/builtin/stable#Deno.mainModule) will
|
||||||
give you the URL of the main module entry point, i.e. the module invoked by
|
give you the URL of the main module entry point, i.e. the module invoked by
|
||||||
the deno runtime
|
the deno runtime.
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
The example below uses two modules to show the difference between
|
The example below uses two modules to show the difference between
|
||||||
`import.meta.url`, `import.meta.main` and `Deno.mainModule`. In this example,
|
`import.meta.url`, `import.meta.main` and `Deno.mainModule`. In this example,
|
||||||
`module_a.ts` is the main module entry point
|
`module_a.ts` is the main module entry point:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
|
|
||||||
## Concepts
|
## Concepts
|
||||||
|
|
||||||
- Use the `--unstable` flag to access new or unstable features in Deno
|
- Use the `--unstable` flag to access new or unstable features in Deno.
|
||||||
- [Deno.signal](https://doc.deno.land/builtin/unstable#Deno.signal) can be used
|
- [Deno.signal](https://doc.deno.land/builtin/unstable#Deno.signal) can be used
|
||||||
to capture and monitor OS signals
|
to capture and monitor OS signals.
|
||||||
- Use the `dispose()` function of the Deno.signal
|
- Use the `dispose()` function of the Deno.signal
|
||||||
[SignalStream](https://doc.deno.land/builtin/unstable#Deno.SignalStream) to
|
[SignalStream](https://doc.deno.land/builtin/unstable#Deno.SignalStream) to
|
||||||
stop watching the signal
|
stop watching the signal.
|
||||||
|
|
||||||
## Async iterator example
|
## Async iterator example
|
||||||
|
|
||||||
|
|
|
@ -6,13 +6,13 @@
|
||||||
[Deno.readTextFile](https://doc.deno.land/builtin/stable#Deno.readTextFile)
|
[Deno.readTextFile](https://doc.deno.land/builtin/stable#Deno.readTextFile)
|
||||||
and
|
and
|
||||||
[Deno.writeTextFile](https://doc.deno.land/builtin/stable#Deno.writeTextFile)
|
[Deno.writeTextFile](https://doc.deno.land/builtin/stable#Deno.writeTextFile)
|
||||||
asynchronous functions for reading and writing entire text files
|
asynchronous functions for reading and writing entire text files.
|
||||||
- Like many of Deno's APIs, synchronous alternatives are also available. See
|
- Like many of Deno's APIs, synchronous alternatives are also available. See
|
||||||
[Deno.readTextFileSync](https://doc.deno.land/builtin/stable#Deno.readTextFileSync)
|
[Deno.readTextFileSync](https://doc.deno.land/builtin/stable#Deno.readTextFileSync)
|
||||||
and
|
and
|
||||||
[Deno.writeTextFileSync](https://doc.deno.land/builtin/stable#Deno.writeTextFileSync)
|
[Deno.writeTextFileSync](https://doc.deno.land/builtin/stable#Deno.writeTextFileSync).
|
||||||
- Use `--allow-read` and `--allow-write` permissions to gain access to the file
|
- Use `--allow-read` and `--allow-write` permissions to gain access to the file
|
||||||
system
|
system.
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
## Concepts
|
## Concepts
|
||||||
|
|
||||||
- Deno is capable of spawning a subprocess via
|
- Deno is capable of spawning a subprocess via
|
||||||
[Deno.run](https://doc.deno.land/builtin/stable#Deno.run)
|
[Deno.run](https://doc.deno.land/builtin/stable#Deno.run).
|
||||||
- `--allow-run` permission is required to spawn a subprocess
|
- `--allow-run` permission is required to spawn a subprocess.
|
||||||
- Spawned subprocesses do not run in a security sandbox
|
- Spawned subprocesses do not run in a security sandbox.
|
||||||
- Communicate with the subprocess via the
|
- Communicate with the subprocess via the
|
||||||
[stdin](https://doc.deno.land/builtin/stable#Deno.stdin),
|
[stdin](https://doc.deno.land/builtin/stable#Deno.stdin),
|
||||||
[stdout](https://doc.deno.land/builtin/stable#Deno.stdout) and
|
[stdout](https://doc.deno.land/builtin/stable#Deno.stdout) and
|
||||||
[stderr](https://doc.deno.land/builtin/stable#Deno.stderr) streams
|
[stderr](https://doc.deno.land/builtin/stable#Deno.stderr) streams.
|
||||||
|
|
||||||
## Simple example
|
## Simple example
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
## Concepts
|
## Concepts
|
||||||
|
|
||||||
- Listening for TCP port connections with
|
- Listening for TCP port connections with
|
||||||
[Deno.listen](https://doc.deno.land/builtin/stable#Deno.listen)
|
[Deno.listen](https://doc.deno.land/builtin/stable#Deno.listen).
|
||||||
- Use [Deno.copy](https://doc.deno.land/builtin/stable#Deno.copy) to take
|
- Use [Deno.copy](https://doc.deno.land/builtin/stable#Deno.copy) to take
|
||||||
inbound data and redirect it to be outbound data
|
inbound data and redirect it to be outbound data.
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
|
|
@ -2,15 +2,15 @@
|
||||||
|
|
||||||
## Concepts
|
## Concepts
|
||||||
|
|
||||||
- Use the Deno runtime API to output the contents of a file to the console
|
- Use the Deno runtime API to output the contents of a file to the console.
|
||||||
- [Deno.args](https://doc.deno.land/builtin/stable#Deno.args) accesses the
|
- [Deno.args](https://doc.deno.land/builtin/stable#Deno.args) accesses the
|
||||||
command line arguments
|
command line arguments.
|
||||||
- [Deno.open](https://doc.deno.land/builtin/stable#Deno.open) is used to get a
|
- [Deno.open](https://doc.deno.land/builtin/stable#Deno.open) is used to get a
|
||||||
handle to a file
|
handle to a file.
|
||||||
- [Deno.copy](https://doc.deno.land/builtin/stable#Deno.copy) is used to
|
- [Deno.copy](https://doc.deno.land/builtin/stable#Deno.copy) is used to
|
||||||
transfer data from the file to the output stream
|
transfer data from the file to the output stream.
|
||||||
- Files should be closed when you are finished with them
|
- Files should be closed when you are finished with them
|
||||||
- Modules can be run directly from remote URLs
|
- Modules can be run directly from remote URLs.
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue