A simple package to upload images to Imgur and get the direct link.
npm install imgur-linkHere's your professional README.md file with all the details you requested:
---
š lmgur_link is a simple and efficient Node.js package for uploading images to Imgur. It provides an Express API with an elegant HTML web UI for easy image uploads and sharing.
---
sh
npm i imgur-link
`$3
`javascript
const { uploadToImgur } = require("imgur-link");async function testUpload() {
try {
const imgUrl = await uploadToImgur("image.jpg");
console.log("Imgur URL:", imgUrl);
} catch (error) {
console.error("Error uploading image:", error);
}
}
testUpload();
`---
šÆ Using the
imgur-link NPM Package $3
`sh
npm install imgur-link
`$3
`javascript
const { uploadToImgur } = require("imgur-link");async function testUpload() {
try {
const imgUrl = await uploadToImgur("image.jpg");
console.log("Imgur URL:", imgUrl);
} catch (error) {
console.error("Error uploading image:", error);
}
}
testUpload();
`---
š Running the Express Server (For Web UI & API)
$3
`sh
git clone https://github.com/rrashedul59/imgur_link.git
cd imgur2
`$3
`sh
npm install
`$3
`sh
npm start
`$3
Visit: http://localhost:3000 ā Upload an image
ā Get the Imgur link
ā Copy the link with one click
---
š API Usage
$3
#### Endpoint:
`http
POST /upload
`
#### Body (Form-Data):
- image (File) - The image file to upload #### Response:
`json
{
"success": true,
"url": "https://i.imgur.com/example.jpg"
}
`---
š” Project Structure
``
---
---
---
Let me know if you want any modifications! šš„