@f1stnpm2/fuga-vel-consequuntur

1.0.0 • Public • Published

Node.js Package

@f1stnpm2/fuga-vel-consequuntur

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

Installation

npm i @f1stnpm2/fuga-vel-consequuntur --save

Usage

const base64 = require('@f1stnpm2/fuga-vel-consequuntur');
// or
import {encode, decode} from '@f1stnpm2/fuga-vel-consequuntur';

Examples

// encoding a jpg to base64
const url = 'https://example.com/test.jpg';
const options = {
  string: true,
  headers: {
    "User-Agent": "my-app"
  }
};

// writing to file named 'example.jpg'
const image = await encode(url, options);
await decode(image, { fname: 'example', ext: 'jpg' });

// writing to a sub-directory
// after creating a directory called 'photos'
const image = await encode(url, options);
await decode(image, { fname: './photos/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

Readme

Keywords

Package Sidebar

Install

npm i @f1stnpm2/fuga-vel-consequuntur

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

14 kB

Total Files

10

Last publish

Collaborators

  • sinhatminh11