aboutsummaryrefslogtreecommitdiff
path: root/docs/guides/write-file/cat.md
blob: a9f9a0ba68418ec68b257048d00c79ad8ae59493 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
---
name: Write a file to stdout
---

Bun exposes `stdout` as a `BunFile` with the `Bun.stdout` property. This can be used as a destination for [`Bun.write()`](/docs/api/file-io#writing-files-bun-write).

This code writes a file to `stdout` similar to the `cat` command in Unix.

```ts#cat.ts
const path = "/path/to/file.txt";
const file = Bun.file(path);
await Bun.write(Bun.stdout, file);
```

---

See [Docs > API > File I/O](/docs/api/file-io#writing-files-bun-write) for complete documentation of `Bun.write()`.
'logsubject'>Fixes #3512 (#3526)Gravatar Jarred Sumner 9-38/+168 * Fixes #3512 * Fix `clearTimeout` and `clearInterval` not cancelling jobs same-tick --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-07-05Fixes #3515 (#3523)Gravatar Jarred Sumner 4-190/+182 Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-07-05Fixes #3520 (#3522)Gravatar Jarred Sumner 3-23/+37 * Fixes #3520 * Update html_rewriter.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-07-05add envs on tests (#3518)Gravatar Ciro Spaciari 4-0/+20 Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> 2023-07-04Update build-idGravatar Jarred Sumner 1-1/+1 2023-07-04Fix build determinism issue (thanks to @alexlamsl)Gravatar Jarred Sumner 1-2/+2 cc @dylan-conway this was the cause 2023-07-04boopGravatar Jarred Sumner 10-55/+55 2023-07-04use sengrid account on nodemailer test (#3517)bun-v0.6.13Gravatar Ciro Spaciari 2-14/+15 2023-07-04[tls] fix servername (#3513)Gravatar Ciro Spaciari 4-8/+109 * fix servername * add postgres tls tests * update test packages * add basic CRUD test 2023-07-04Add alias for readBigUInt64BE ... (#3514)Gravatar Ai Hoshino 2-4/+58 * Add alias for `readBigUInt64BE` ... Close: https://github.com/oven-sh/bun/issues/3338 * add some tests for `readBigUint64BE` alias * format code 2023-07-04reduce countGravatar Jarred Sumner 1-2/+2 2023-07-04bumpGravatar Jarred Sumner 3-2/+2 2023-07-04Fix crashGravatar Jarred Sumner 1-5/+8