node-base64-image
node-base64-image copied to clipboard
[Suggestion] Return metadata
Hi, I'm using this lib for about 4 months now and the only thing I guess could be improved is a new option param that returns the base64 string + some metadata such as format
, maybe its size (width/height), etc.
The format
I guess that it's possible to get on the Axios request itself, and the size would be possible to get using something such as probe-image-size.
That's all, cheers.
const response = encode(url, {
metadata: true, // it could be a better naming fore sure 👍
})
console.log(response)
/*
* {
* data: <base64>,
* format: <jpg, png, etc>,
* width: <number>,
* height: <number>,
* }
*/