import { UrlBase64 } from "@gogh/url-to-base64"
const { mimetype, data } = await UrlBase64.fromUrl(url)
console.log(mimetype, data)
/*
mimetype is an image/jpg | application/pdf or any mimetype format
data is a base64 raw
data:${mimetype};base64,${data}
*/
// Other way for make the same
// filePath is './image.jpg' or any route in your local file system
const { mimetype, data } = await UrlBase64.fromFilePath(url)
console.log(mimetype, data)
-
Notifications
You must be signed in to change notification settings - Fork 0
License
Elimeleth/urlToBase64
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published