Skip to content

Bun 은 Uint8Array 와 같은 이진 데이터 유형에서 문자열로 변환하기 위한 Web 표준 TextDecoder 클래스를 구현합니다.

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

Bun 으로 이진 데이터를 조작하는 방법에 대한 전체 문서는 문서 > API > 이진 데이터 를 참조하세요.

Bun by www.bunjs.com.cn 편집