summaryrefslogtreecommitdiff
path: root/prettier/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'prettier/README.md')
-rw-r--r--prettier/README.md15
1 files changed, 12 insertions, 3 deletions
diff --git a/prettier/README.md b/prettier/README.md
index 3a8d5a0c2..6485d2da2 100644
--- a/prettier/README.md
+++ b/prettier/README.md
@@ -6,22 +6,31 @@ Prettier APIs and tools for deno
To formats the source files, run:
-```console
+```bash
deno --allow-read --allow-write https://deno.land/std/prettier/main.ts
```
You can format only specific files by passing the arguments.
-```console
+```bash
deno --allow-read --allow-write https://deno.land/std/prettier/main.ts path/to/script.ts
```
You can format files on specific directory by passing the directory's path.
-```console
+```bash
deno --allow-read --allow-write https://deno.land/std/prettier/main.ts path/to/script.ts
```
+You can format the input plain text stream. default parse it as typescript code.
+
+```bash
+cat path/to/script.ts | deno https://deno.land/std/prettier/main.ts
+cat path/to/script.js | deno https://deno.land/std/prettier/main.ts --stdin-parser=babel
+cat path/to/config.json | deno https://deno.land/std/prettier/main.ts --stdin-parser=json
+cat path/to/README.md | deno https://deno.land/std/prettier/main.ts --stdin-parser=markdown
+```
+
## Use API
You can use APIs of prettier as the following: