Skip to content

useBase64 ​

Category
Last Changed
9月29日16时14分

Reactive base64 transforming. Supports plain text, buffer, files, canvas, objects, maps, sets and images.

Demo ​

Text Input
Base64
Buffer Input
new ArrayBuffer(1024)
Base64
File Input
Base64
Image Input
Base64

Usage ​

ts
import { useBase64 } from 'comuse-core'
import { shallowRef } from 'vue'

const text = shallowRef('')

const { base64 } = useBase64(text)

If you use object, array, map or set you can provide serializer in options. Otherwise, your data will be serialized by default serializer. Objects and arrays will be transformed in string by JSON.stringify. Map and set will be transformed in object and array respectively before stringify.

Source ​

Source • Demo • Docs

Changelog ​

v4.1.5 on 9/29/2025
8b546 - feat: add useBase64

Released under the MIT License.