Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new examples section which holds all examples, tutorials and videos #1245

Merged
merged 20 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update links
  • Loading branch information
thisisjofrank committed Dec 10, 2024
commit 4e2057b77c90a572e1d71cfbb2f0030f64288591
3 changes: 1 addition & 2 deletions examples/scripts/benchmarking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
* @difficulty beginner
* @tags cli
* @run deno bench <url>
* @resource {https://docs.deno.com/runtime/reference/cli/benchmarker} Manual: Benchmarker tool
* @resource {/examples/http-requests} Example: HTTP Requests
* @resource {https://docs.deno.com/runtime/reference/cli/benchmarker} Manual: Benchmarker tool_requests} Example: HTTP Requests
* @group System
*
* When writing libraries, a very common task that needs to be done is
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/scripts/parsing_serializing_csv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @difficulty beginner
* @tags cli, deploy, web
* @run <url>
* @resource {/examples/import-export} Example: Importing & Exporting
* @resource {/examples/import_export} Example: Importing & Exporting
* @resource {https://datatracker.ietf.org/doc/html/rfc4180} Spec: CSV
* @group Encoding
*
Expand Down
2 changes: 1 addition & 1 deletion examples/scripts/parsing_serializing_yaml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @difficulty beginner
* @tags cli, deploy, web
* @run <url>
* @resource {/examples/import-export} Example: Importing & Exporting
* @resource {/examples/import_export} Example: Importing & Exporting
* @resource {https://yaml.org} Spec: YAML
* @group Encoding
*
Expand Down
2 changes: 1 addition & 1 deletion examples/scripts/piping_streams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @tags cli
* @run --allow-net --allow-read --allow-write <url>
* @resource {https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream} MDN: ReadableStream
* @resource {/examples/tcp-listener} Example: TCP Listener
* @resource {/examples/tcp_listener} Example: TCP Listener
* @group Network
*
* Deno implements web-standard streams which comes with many advantages. One of the most useful
Expand Down
2 changes: 1 addition & 1 deletion examples/scripts/tcp_connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @tags cli
* @run --allow-net <url>
* @resource {https://docs.deno.com/api/deno/~/Deno.connect} Doc: Deno.connect
* @resource {/examples/tcp-listener} Example: TCP Listener
* @resource {/examples/tcp_listener} Example: TCP Listener
* @group Network
*
* An example of connecting to a TCP server on localhost and writing a 'ping' message to the server.
Expand Down
2 changes: 1 addition & 1 deletion examples/scripts/tls_connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @tags cli
* @run --allow-net --allow-read <url>
* @resource {https://docs.deno.com/api/deno/~/Deno.connectTls} Doc: Deno.connectTls
* @resource {/examples/tls-listener} Example: TCP/TLS Listener
* @resource {/examples/tls_listener} Example: TCP/TLS Listener
* @group Network
*
* An example of connecting to a TCP server using TLS on localhost and writing a 'ping' message to the server.
Expand Down
2 changes: 1 addition & 1 deletion examples/scripts/udp_connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @tags cli
* @run --allow-net --unstable-net <url>
* @resource {https://docs.deno.com/api/deno/~/Deno.connect} Doc: Deno.connect
* @resource {/examples/udp-listener} Example: UDP Listener
* @resource {/examples/udp_listener} Example: UDP Listener
* @group Unstable APIs
*
* <strong>Warning: This is an unstable API that is subject to change or removal at anytime.</strong><br>An example of writing a 'ping' message to a UDP server on localhost.
Expand Down
2 changes: 1 addition & 1 deletion examples/scripts/udp_listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @tags cli
* @run --allow-net --unstable-net <url>
* @resource {https://docs.deno.com/api/deno/~/Deno.listenDatagram} Doc: Deno.listenDatagram
* @resource {/examples/udp-connector} Example: UDP Connector
* @resource {/examples/udp_connector} Example: UDP Connector
* @group Unstable APIs
*
* <strong>Warning: This is an unstable API that is subject to change or removal at anytime.</strong><br>An example of a UDP listener on localhost that will log the message
Expand Down
2 changes: 1 addition & 1 deletion examples/scripts/websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @difficulty beginner
* @tags cli, deploy, web
* @run --allow-net <url>
* @resource {/examples/http-server-websocket} HTTP Server: WebSockets
* @resource {/examples/http_server_websocket} HTTP Server: WebSockets
* @resource {https://developer.mozilla.org/en-US/docs/Web/API/WebSocket} MDN: WebSocket
* @group Network
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Build a React app with create-vite"
url: /examples/create-react_tutorial/
url: /examples/create_react_tutorial/
oldUrl:
- /runtime/tutorials/how_to_with_npm/create-react/
---
Expand Down
24 changes: 12 additions & 12 deletions index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,15 @@ export default function () {
},
{
text: "Hello World",
href: "/examples/hello-world",
href: "/examples/hello_world",
},
{
text: "Using Node.js built-in modules",
href: "/examples/node",
href: "/examples/node_built_in",
},
{
text: "Manipulating & Parsing URLs",
href: "/examples/url-parsing",
href: "/examples/url_parsing",
},
]}
/>
Expand All @@ -176,19 +176,19 @@ export default function () {
links={[
{
text: "HTTP Server: Hello World",
href: "/examples/http-server",
href: "/examples/http_server",
},
{
text: "HTTP Server: WebSockets",
href: "/examples/http-server-websocket",
href: "/examples/http_server_websocket",
},
{
text: "HTTP Server: Streaming",
href: "/examples/http-server-streaming",
href: "/examples/http_server_streaming",
},
{
text: "TCP Connector: Ping",
href: "/examples/tcp-connector",
href: "/examples/tcp_connector",
},
]}
/>
Expand All @@ -198,19 +198,19 @@ export default function () {
links={[
{
text: "Command Line Arguments",
href: "/examples/command-line-arguments",
href: "/examples/command_line_arguments",
},
{
text: "Environment Variables",
href: "/examples/environment-variables",
href: "/examples/environment_variables",
},
{
text: "Reading Files",
href: "/examples/reading-files",
href: "/examples/reading_files",
},
{
text: "Walking directories",
href: "/examples/walking-directories",
href: "/examples/walking_directories",
},
]}
/>
Expand All @@ -232,7 +232,7 @@ export default function () {
},
{
text: "KV Watch",
href: "/examples/kv-watch",
href: "/examples/kv_watch",
},
]}
/>
Expand Down
10 changes: 5 additions & 5 deletions runtime/reference/cli/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ command: run

## Usage

To run [this file](https://docs.deno.com/examples/scripts/hello-world.ts) use:
To run [this file](https://docs.deno.com/examples/scripts/hello_world.ts) use:

```console
deno run https://docs.deno.com/examples/scripts/hello-world.ts
deno run https://docs.deno.com/examples/scripts/hello_world.ts
```

You can also run files locally. Ensure that you are in the correct directory and
Expand Down Expand Up @@ -47,7 +47,7 @@ deno run -A server.ts
```

If your project requires multiple security flags you should consider using a
[`deno task`](./task_runner) to execute them.
[`deno task`](/runtime/reference/cli/task/) to execute them.

## Watch

Expand All @@ -66,15 +66,15 @@ console if there are errors while you work.

## Running a package.json script

`package.json` scripts can be executed with the [`deno task`](./task_runner)
`package.json` scripts can be executed with the [`deno task`](/runtime/reference/cli/task/)
command.

## Running code from stdin

You can pipe code from stdin and run it immediately with:

```console
curl https://docs.deno.com/learn/examples/hello-world.ts | deno run -
curl https://docs.deno.com/examples/scripts/hello_world.ts | deno run -
```

## Terminate run
Expand Down
5 changes: 2 additions & 3 deletions runtime/reference/deno_namespace_apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ to the file system.
Refer to the links below for code examples of how to use the file system
functions.

- [Reading files in several different ways](/examples/reading-files/)
- [Reading files in streams](/examples/file_server_tutorial/)
- [Reading a text file (`Deno.readTextFile`)](/examples/reading-files/)
- [Writing a text file (`Deno.writeTextFile`)](/examples/writing-files/)
- [Reading a text file (`Deno.readTextFile`)](/examples/reading_files/)
- [Writing a text file (`Deno.writeTextFile`)](/examples/writing_files/)

## Network

Expand Down
Loading