Download images from remote URLs or use local images and encode/decode them to Base64 string or Buffer object
Download images from remote URLs or use local images and encode/decode them to Base64 string or Buffer object
npm i node-base64-image --save
const base64 = require('node-base64-image');
// or
import {encode, decode} from 'node-base64-image';
const url = 'https://example.com/test.jpg';
const options = {
string: true,
headers: {
"User-Agent": "my-app"
}
};
const image = await encode(url, options);
await decode(image, { fname: 'example', ext: 'jpg' });
Read the CONTRIBUTING guide for information.
Licensed under MIT. See LICENSE for more information.
Report a bug in issues.
Made with love in Dhaka, Bangladesh by Riyadh Al Nur