node-base64-image

Download images from remote URLs and encode/decode them to base64

Usage no npm install needed!

<script type="module">
  import nodeBase64Image from 'https://cdn.skypack.dev/node-base64-image';
</script>

README

Node.js Package

node-base64-image

Download images from remote URLs or use local images and encode/decode them to Base64 string or Buffer object

Installation

npm i node-base64-image --save

Usage

const base64 = require('node-base64-image');
// or
import {encode, decode} from 'node-base64-image';

Examples

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' });

Contributing

Read the CONTRIBUTING guide for information.

License

Licensed under MIT. See LICENSE for more information.

Issues

Report a bug in issues.

Made with love in Dhaka, Bangladesh by Riyadh Al Nur