1.0.1 • Published 12 months ago

upimages v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
12 months ago

The upimages package is a utility that provides an easy way to upload images and retrieve their URLs . Here's a step-by-step guide on how to use the upimages package with a code example:

1- Install the necessary dependencies: The UpImages package relies on Axios, FormData, and Puppeteer. Make sure you have these dependencies installed in your project by running the following command:

npm install upimages

2- Import the UpImage class: In your code file, import the UpImage class from the 'upimages' package using the following code:

const UpImage = require('upimages');

3- Create an instance of UpImage: Instantiate an UpImage object by passing the image file to the constructor. This object will handle the image upload and retrieval.

const image = new UpImage(imageFile);

4- Use the UpImage object to get the image URL: To retrieve the URL of the uploaded image, call the getImageUrl() method of the UpImage object. Since getImageUrl() is an asynchronous function, you need to await the result to get the resolved URL.

(async () => {
  const imageUrl = await image.getImageUrl();
  console.log(imageUrl);
})();
1.0.1

12 months ago

1.0.0

12 months ago