Socket
Socket
Sign inDemoInstall

isomorphic-textencoder

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    isomorphic-textencoder

encode/decode Uint8Arrays to strings


Version published
Weekly downloads
5.9K
decreased by-10.87%
Maintainers
1
Install size
37.7 kB
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 23 Nov 2018

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc