Socket
Socket
Sign inDemoInstall

encode-utf8

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    encode-utf8

Turn a string into an ArrayBuffer by using the UTF8 encoding.


Version published
Weekly downloads
1.8M
increased by1.6%
Maintainers
1
Install size
5.72 kB
Created
Weekly downloads
 

Readme

Source

Encode UTF8

Turn a string into an ArrayBuffer by using the UTF8 encoding.

Installation

npm install --save encode-utf8

Usage

import encodeUtf8 from 'encode-utf8'

console.log(encodeUtf8('Hello, World!'))
//=> ArrayBuffer { byteLength: 13 }

console.log(encodeUtf8('🐵 🙈 🙉 🙊'))
//=> ArrayBuffer { byteLength: 19 }

API

encodeUtf8(input)

  • input (string, required)
  • returns ArrayBuffer - an ArrayBuffer with the input string represented as UTF8 encoded data

FAQs

Last updated on 24 Jul 2021

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