Skip to content

add stdin option on README #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down