Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/billiegoose/isomorphic-textencoder
encode/decode Uint8Arrays to strings
https://github.com/billiegoose/isomorphic-textencoder
Last synced: 24 days ago
JSON representation
encode/decode Uint8Arrays to strings
- Host: GitHub
- URL: https://github.com/billiegoose/isomorphic-textencoder
- Owner: billiegoose
- License: mit
- Created: 2018-11-19T06:23:46.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-23T20:11:43.000Z (about 6 years ago)
- Last Synced: 2024-04-14T06:06:13.746Z (9 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# isomorphic-textencoder
encode/decode Uint8Arrays to stringsThis is just a thin wrapper that provides an isomorphic API.
- To perform UTF8 conversion in the browser it uses the native TextEncoder.
- It includes a polyfill so IE11 / Edge aren't left out.
- In Node it uses native Buffer methods.## Installation
```sh
npm install isomorphic-textencoder --save
```## Usage
```js
import { encode, decode } from "isomorphic-textencoder";encode('Hello') // Uint8Array [ 72, 101, 108, 108, 111 ]
decode(new Uint8Array([72, 101, 108, 108, 111])) // 'Hello'
```## Dependencies
None
## Dev Dependencies
None
## License
MIT