@topgunbuild/textencoder
v0.0.3
Published
An isomorphic encode/decode Uint8Arrays to strings for Javascript in Node and the browser
Downloads
20,169
Maintainers
Readme
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 @topgunbuild/textencoder
Usage
const textencoder = require('@topgunbuild/textencoder')
// or
import textencoder from '@topgunbuild/textencoder';
textencoder.encode('Hello') // Uint8Array [ 72, 101, 108, 108, 111 ]
License
MIT