diff options
author | Axetroy <axetroy.dev@gmail.com> | 2019-06-30 23:10:00 +0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-06-30 11:10:00 -0400 |
commit | 78a9a27e6fcecdac9a11cb01adf585feceed9e18 (patch) | |
tree | ee9f3abb0a209f3767d500e5153fbc95c8b5c77e /prettier/README.md | |
parent | 6d4473324f4fd20a2d138bb6dc264bc4d9337868 (diff) |
prettier: support reading code from stdin (denoland/deno_std#498)
Original: https://github.com/denoland/deno_std/commit/85db520b60053db5dc9b56972bfb6bee506dc158
Diffstat (limited to 'prettier/README.md')
-rw-r--r-- | prettier/README.md | 15 |
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: |