Skip to content

Commit ad1e73b

Browse files
committed
Merge pull request #11 from tgfjt/patch-1
add stdin option on README
2 parents 4c4ab8b + b2dddf3 commit ad1e73b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ $ tsfmt
1212
-h, --help output usage information
1313
-V, --version output the version number
1414
-r, --replace replace .ts file
15+
--stdin get formatting content from stdin
1516
--no-tslint don't read a tslint.json
1617
--no-editorconfig don't read a .editorconfig
1718
--no-tsfmt don't read a tsfmt.json
@@ -37,6 +38,13 @@ class Sample { hello(word= "world") { return "Hello, " + word; } }
3738
new Sample().hello("TypeScript");
3839
```
3940
41+
```bash
42+
# from stdin. read from stdin, output to stdout.
43+
$ cat sample.ts | tsfmt --stdin sample.ts
44+
class Sample { hello(word= "world") { return "Hello, " + word; } }
45+
new Sample().hello("TypeScript");
46+
```
47+
4048
```bash
4149
# replace. read file, and replace file.
4250
$ tsfmt -r sample.ts

0 commit comments

Comments
 (0)