JSPM

isomorphic-textencoder

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 72886
  • Score
    100M100P100Q158466F
  • License MIT

encode/decode Uint8Arrays to strings

Package Exports

  • isomorphic-textencoder

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (isomorphic-textencoder) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

isomorphic-textencoder

encode/decode Uint8Arrays to strings

To perform UTF8 conversion in the browser it uses the native TextEncoder. In Node it uses native Buffer methods. This is just a thin wrapper that provides an isomorphic API.

Installation

npm install isomorphic-textencoder --save

Usage

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