package
Turn a string into an ArrayBuffer by using the UTF8 encoding.
npm install encode-utf8GitHub-flavored package documentation.
Across all versions, last 30 days.
15,148,520 in 30 days
Runtime metadata.
Estimated unpacked size across 1 packages.
4.7 kB
Includes dependencies.
Turn a string into an ArrayBuffer by using the UTF8 encoding.
npm install --save encode-utf8import encodeUtf8 from 'encode-utf8'
console.log(encodeUtf8('Hello, World!'))
//=> ArrayBuffer { byteLength: 13 }
console.log(encodeUtf8('🐵 🙈 🙉 🙊'))
//=> ArrayBuffer { byteLength: 19 }encodeUtf8(input)input (string, required)ArrayBuffer - an ArrayBuffer with the input string represented as UTF8 encoded data