diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-08-05 18:00:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-05 18:00:28 -0400 |
commit | 782ebfbc0f317dff32daac40c42930abd6985f50 (patch) | |
tree | 7cb67ceb989f3207787266cfcf6cb10beb05eb18 | |
parent | b1e5ad7eca8a1c6e38bb326daee9775b41687cf9 (diff) |
Fix URLs in examples/README (denoland/deno_std#551)
Original: https://github.com/denoland/deno_std/commit/6d78eec41306b98943847a5d1ec3bcaf389698fd
-rw-r--r-- | examples/README.md | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/examples/README.md b/examples/README.md index 6a4924f5d..745972f5f 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,36 +1,47 @@ # Deno example programs -This module contains small scripts that demonstrate use of Deno and its standard library. +This module contains small scripts that demonstrate use of Deno and its standard +module. -You can run these examples by importing them via `deno` command: +You can run these examples using just their URL or install the example as an +executable script which references the URL. (Think of installing as creating a +bookmark to a program.) -``` -> deno https://deno.land/std/examples/echo_server.ts --allow-net -``` +### A TCP echo server -Some of them are useful CLI programs that can be installed as executables: +```shell +deno https://deno.land/std/examples/echo_server.ts --allow-net +``` -`cat.ts` - print file to standard output +Or +```shell +deno install echo_server https://deno.land/std/examples/echo_server.ts --allow-net ``` -deno install deno_cat https://deno.land/examples.cat.ts --allow-read + +### cat - print file to standard output + +```shell +deno install deno_cat https://deno.land/stdexamples/cat.ts --allow-read deno_cat file.txt ``` -`catj.ts` - print flattened JSON to standard output +### catj - print flattened JSON to standard output -``` -deno install catj https://deno.land/examples/catj.ts --allow-read +A very useful command by Soheil Rashidi ported to Deno. + +```shell +deno install catj https://deno.land/std/examples/catj.ts --allow-read catj example.json catj file1.json file2.json echo example.json | catj - ``` -`gist.ts` - easily create and upload Gists +### gist - easily create and upload Gists ``` -deno install gist https://deno.land/examples/gist.ts --allow-net --allow-env export GIST_TOKEN=ABC # Generate at https://github.com/settings/tokens +deno install gist https://deno.land/std/examples/gist.ts --allow-net --allow-env gist --title "Example gist 1" script.ts gist --t "Example gist 2" script2.ts ``` |