summaryrefslogtreecommitdiff
path: root/std/examples
diff options
context:
space:
mode:
authorzjopy <33468089+zjopy@users.noreply.github.com>2020-05-07 13:48:48 +0200
committerGitHub <noreply@github.com>2020-05-07 13:48:48 +0200
commit761b7efb3b8a140caad12803619a2e8a535cc178 (patch)
treec046d2fe25453713284e1670f10ceae05bac2673 /std/examples
parent34ec3b225425cecdccf754fbc87f4a8f3728890d (diff)
fix(docs): add missing "deno run" (#5126)
Diffstat (limited to 'std/examples')
-rw-r--r--std/examples/README.md6
-rw-r--r--std/examples/xeval.ts8
2 files changed, 7 insertions, 7 deletions
diff --git a/std/examples/README.md b/std/examples/README.md
index 1c47d258e..cdc477833 100644
--- a/std/examples/README.md
+++ b/std/examples/README.md
@@ -10,7 +10,7 @@ bookmark to a program.)
### A TCP echo server
```shell
-deno --allow-net https://deno.land/std/examples/echo_server.ts
+deno run --allow-net https://deno.land/std/examples/echo_server.ts
```
Or
@@ -40,7 +40,7 @@ echo example.json | catj -
### curl - print the contents of a url to standard output
```shell
-deno --allow-net=deno.land https://deno.land/std/examples/curl.ts https://deno.land/
+deno run --allow-net=deno.land https://deno.land/std/examples/curl.ts https://deno.land/
```
### gist - easily create and upload Gists
@@ -55,7 +55,7 @@ gist --t "Example gist 2" script2.ts
### chat - WebSocket chat server and browser client
```shell
-deno --allow-net --allow-read https://deno.land/std/examples/chat/server.ts
+deno run --allow-net --allow-read https://deno.land/std/examples/chat/server.ts
```
Open http://localhost:8080 on the browser.
diff --git a/std/examples/xeval.ts b/std/examples/xeval.ts
index 6589fec16..d688a6bf7 100644
--- a/std/examples/xeval.ts
+++ b/std/examples/xeval.ts
@@ -14,16 +14,16 @@ const HELP_MSG = `xeval
Run a script for each new-line or otherwise delimited chunk of standard input.
Print all the usernames in /etc/passwd:
- cat /etc/passwd | deno -A https://deno.land/std/examples/xeval.ts "a = $.split(':'); if (a) console.log(a[0])"
+ cat /etc/passwd | deno run -A https://deno.land/std/examples/xeval.ts "a = $.split(':'); if (a) console.log(a[0])"
A complicated way to print the current git branch:
- git branch | deno -A https://deno.land/std/examples/xeval.ts -I 'line' "if (line.startsWith('*')) console.log(line.slice(2))"
+ git branch | deno run -A https://deno.land/std/examples/xeval.ts -I 'line' "if (line.startsWith('*')) console.log(line.slice(2))"
Demonstrates breaking the input up by space delimiter instead of by lines:
- cat LICENSE | deno -A https://deno.land/std/examples/xeval.ts -d " " "if ($ === 'MIT') console.log('MIT licensed')",
+ cat LICENSE | deno run -A https://deno.land/std/examples/xeval.ts -d " " "if ($ === 'MIT') console.log('MIT licensed')",
USAGE:
- deno -A https://deno.land/std/examples/xeval.ts [OPTIONS] <code>
+ deno run -A https://deno.land/std/examples/xeval.ts [OPTIONS] <code>
OPTIONS:
-d, --delim <delim> Set delimiter, defaults to newline
-I, --replvar <replvar> Set variable name to be used in eval, defaults to $