šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

isomorphic-textencoder

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

isomorphic-textencoder

encode/decode Uint8Arrays to strings

1.0.1
latest
Source
npm
Version published
Weekly downloads
44K
-10.6%
Maintainers
1
Weekly downloads
Ā 
Created
Source

isomorphic-textencoder

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.
    • It includes a polyfill so IE11 / Edge aren't left out.
  • In Node it uses native Buffer methods.

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

Keywords

textencoder

FAQs

Package last updated on 23 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts