1.0.1 • Published 11 months ago

topgun-textencoder v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

What?

Encode/decode Uint8Arrays to strings.

This is just a thin wrapper that provides an isomorphic API.

  • To perform UTF8 conversion in the browser it uses the native TextEncoder.
  • In Node it uses Buffer and Uint8Array.

Install

npm install topgun-textencoder

Usage

const textencoder = require('topgun-textencoder')
// or
import textencoder from 'topgun-textencoder';

textencoder.encode('Hello') // Uint8Array [ 72, 101, 108, 108, 111 ]

License

MIT