diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-10-10 05:31:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-10 05:31:23 -0400 |
commit | e7562eed8c816cd0d97aab6b818d7c8453dbaa2b (patch) | |
tree | c5a9f536e79d2c8d2d02897511a9138acaf35394 /std/examples/README.md | |
parent | 3882c9d19a641e0c919f1350d87c6d7ee280cf78 (diff) | |
parent | 93f7f00c956c14620ef031626f124b57397ca867 (diff) |
Merge deno_std in main repo (#3091)
The history of deno_std is persevered but rewritten to update links to issues and PRs
Fixes denoland/deno_std#603
Diffstat (limited to 'std/examples/README.md')
m--------- | std | 0 | ||||
-rw-r--r-- | std/examples/README.md | 47 |
2 files changed, 47 insertions, 0 deletions
diff --git a/std b/std deleted file mode 160000 -Subproject 43aafbf33285753e7b42230f0eb7969b300f71c diff --git a/std/examples/README.md b/std/examples/README.md new file mode 100644 index 000000000..e6102a843 --- /dev/null +++ b/std/examples/README.md @@ -0,0 +1,47 @@ +# Deno example programs + +This module contains small scripts that demonstrate use of Deno and its standard +module. + +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.) + +### A TCP echo server + +```shell +deno https://deno.land/std/examples/echo_server.ts --allow-net +``` + +Or + +```shell +deno install echo_server https://deno.land/std/examples/echo_server.ts --allow-net +``` + +### cat - print file to standard output + +```shell +deno install deno_cat https://deno.land/std/examples/cat.ts --allow-read +deno_cat file.txt +``` + +### catj - print flattened JSON to standard output + +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 - easily create and upload Gists + +``` +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 +``` |