npm install utf8-uint8array
or
yarn add utf8-uint8array
import { toBytes } from "utf8-uint8array";
const bytes: Uint8Array = toBytes("Привет 🌎");
import { fromBytes } from "utf8-uint8array";
const bytes: Uint8Array;
const string: string = fromBytes(bytes);