aboutsummaryrefslogtreecommitdiff
path: root/docs/guides/binary/arraybuffer-to-string.md
blob: 13bb83122b2fe1870aff97af6657c5018f0b41f0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
---
name: Convert an ArrayBuffer to a string
---

Bun implements the Web-standard [`TextDecoder`](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder) class for converting between binary data types and strings.

```ts
const buf = new ArrayBuffer(64);
const decoder = new TextDecoder();
const str = decoder.decode(buf);
```

---

See [Docs > API > Binary Data](/docs/api/binary-data#conversion) for complete documentation on manipulating binary data with Bun.
a>Gravatar Ciro Spaciari 3-6/+7 2023-02-06Add types for node:console and node:perf_hooks (#1982)Gravatar Colin McDonnell 8-153/+1342 2023-02-06mark bindingGravatar Dylan Conway 1-0/+1 2023-02-06Fix URL of wasi-js (#1997)Gravatar Cheng Shao 2-3/+3 2023-02-05speed it up a little moreGravatar Jarred Sumner 4-119/+290 2023-02-05`substringSharingImpl` allocates, do not useGravatar Jarred Sumner 2-57/+27 2023-02-05Faster Buffer.toString("ascii")Gravatar Jarred Sumner 1-8/+35 2023-02-04Bump querystring-es3 (#1988)Gravatar Gaurish Sethia 2-9/+36 2023-02-04Add `isDeepStructEqual` to `node:util`Gravatar Jarred Sumner 1-2/+6 2023-02-03Fixes #1978Gravatar Jarred Sumner 1-3/+7 2023-02-03Implement os.cpus() for Linux (#1977)Gravatar Justin Whear 1-2/+138 2023-02-03Support passing `Date` to `Bun.sleep`Gravatar Jarred Sumner 3-3/+27 2023-02-03Add test for propagating exceptionGravatar Jarred Sumner 3-5/+28 2023-02-03Add missing crypto exportGravatar Jarred Sumner 2-16/+22 2023-02-03Introduce `await Bun.sleep(ms)`Gravatar Jarred Sumner 5-15/+110 2023-02-03Fix types for `Array.fromAsync`Gravatar Ashcon Partovi 1-1/+1 2023-02-03Fix/Update Typescript types (#1972)Gravatar Gaurish Sethia 2-168/+38 2023-02-03fix require("perf_hooks")Gravatar Jarred Sumner 1-0/+1 2023-02-03allow other ArrayBufferView in Buffer functionsGravatar Jarred Sumner 1-6/+6 2023-02-03Make it less flakyGravatar Jarred Sumner 1-1/+1 2023-02-03Run tests on pull requestsGravatar Ashcon Partovi 1-0/+7 2023-02-03Run tests on pushGravatar Ashcon Partovi 1-0/+7 2023-02-03anotherGravatar Dylan Conway 1-1/+1 2023-02-03integers overflowingGravatar Dylan Conway 1-1/+1 2023-02-03Attempt to debug annotations 2Gravatar Ashcon Partovi 1-4/+1 2023-02-03Attempt to debug annotationsGravatar Ashcon Partovi 1-0/+7 2023-02-03Fix console output in bun wiptestGravatar Ashcon Partovi 1-4/+3 2023-02-03Use GitHub action SDKGravatar Ashcon Partovi 4-10/+16