summaryrefslogtreecommitdiff
path: root/examples/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'examples/README.md')
-rw-r--r--examples/README.md32
1 files changed, 25 insertions, 7 deletions
diff --git a/examples/README.md b/examples/README.md
index c4def7b7c..6a4924f5d 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -1,18 +1,36 @@
-# Deno Example Programs
+# Deno example programs
-These files are accessible for import via "https://deno.land/std/examples/".
+This module contains small scripts that demonstrate use of Deno and its standard library.
-Try it:
+You can run these examples by importing them via `deno` command:
```
-> deno https://deno.land/std/examples/gist.ts README.md
+> deno https://deno.land/std/examples/echo_server.ts --allow-net
```
-## Alias Based Installation
+Some of them are useful CLI programs that can be installed as executables:
-Add this to your `.bash_profile`
+`cat.ts` - print file to standard output
```
+deno install deno_cat https://deno.land/examples.cat.ts --allow-read
+deno_cat file.txt
+```
+
+`catj.ts` - print flattened JSON to standard output
+
+```
+deno install catj https://deno.land/examples/catj.ts --allow-read
+catj example.json
+catj file1.json file2.json
+echo example.json | catj -
+```
+
+`gist.ts` - 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
-alias gist="deno --allow-net --allow-env https://deno.land/std/examples/gist.ts"
+gist --title "Example gist 1" script.ts
+gist --t "Example gist 2" script2.ts
```