decode-utf8
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Decode UTF8

Turn an ArrayBuffer or Uint8Array of UTF8 data into a string.

Installation

npm install --save decode-uf8

Usage

const decodeUtf8 = require('decode-utf8')
 
console.log(decodeUtf8(Uint8Array.of(72, 101, 108, /* ... */ 108, 100, 33)))
//=> Hello, World!
 
console.log(decodeUtf8(Uint8Array.of(240, 159, 144, /* ... */ 159, 153, 138)))
//=> 🐵 🙈 🙉 🙊

API

decodeUtf8(input: ArrayBuffer | Uint8Array): string

Returns a string representing the input data interpreted as UTF8.

Readme

Keywords

none

Package Sidebar

Install

npm i decode-utf8

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • linusu