diff --git a/README.md b/README.md index b554199..309aa04 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ $ tsfmt -h, --help output usage information -V, --version output the version number -r, --replace replace .ts file + --stdin get formatting content from stdin --no-tslint don't read a tslint.json --no-editorconfig don't read a .editorconfig --no-tsfmt don't read a tsfmt.json @@ -37,6 +38,13 @@ class Sample { hello(word= "world") { return "Hello, " + word; } } new Sample().hello("TypeScript"); ``` +```bash +# from stdin. read from stdin, output to stdout. +$ cat sample.ts | tsfmt --stdin sample.ts +class Sample { hello(word= "world") { return "Hello, " + word; } } +new Sample().hello("TypeScript"); +``` + ```bash # replace. read file, and replace file. $ tsfmt -r sample.ts