Skip to content

Bun implementiert die Web-Standard- TextDecoder Klasse zur Konvertierung von Binärdatentypen wie Uint8Array und Strings.

ts
const arr = new Uint8Array([104, 101, 108, 108, 111]);
const decoder = new TextDecoder();
const str = decoder.decode(arr);
// => "hello"

Siehe Docs > API > Binärdaten für vollständige Dokumentation zur Manipulation von Binärdaten mit Bun.

Bun von www.bunjs.com.cn bearbeitet