Skip to content

Commit

Permalink
Merge pull request #24 from zth/update-readme
Browse files Browse the repository at this point in the history
Add open NodeJs to readme examples
  • Loading branch information
TheSpyder authored Jan 24, 2024
2 parents e16692c + ea55d7e commit 4cc5c5a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,18 @@ Help all ReScript Node.js apps and libraries to be built faster by reducing the
### Stream a file into stdout:

```rescript
open NodeJs
Fs.createReadStream("/path")
->Stream.pipe(Process.(stdout(process)))
->Stream.pipe(Process.stdout(Process.process))
->Stream.onError(_ => Js.log("handleError"))
```

### Echo server:

```rescript
open NodeJs
Http.createServer((request, response) => {
request->Stream.onData(data => Js.log(data))
request->Stream.pipe(response)->ignore
Expand Down

0 comments on commit 4cc5c5a

Please sign in to comment.