encode-utf8
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    2,094
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.0
    2,094
  • 1.0.3
    1,813,832
  • 1.0.2
    3
  • 1.0.1
    8
  • 1.0.0
    0

Package Sidebar

Install

npm i encode-utf8

Weekly Downloads

1,815,937

Version

2.0.0

License

MIT

Unpacked Size

4.79 kB

Total Files

6

Last publish

Collaborators

  • linusu