{"library":"node-upload-images","title":"Node.js Image Upload Library","description":"node-upload-images is a lightweight Node.js library designed for uploading images to various popular free image hosting services, including new.fastpic.org, pixhost.to, postimages.org, and upload.cc. The library leverages Axios for HTTP requests and provides built-in support for TypeScript, making it suitable for modern JavaScript and TypeScript projects. It currently stands at version 1.0.1, with releases appearing to be infrequent since its initial launch. A notable feature is its ability to bypass DDoS protection for upload.cc using the `axios-ddos-guard-bypass` package. It supports uploading images from binary data, local file paths, or remote URLs. A key limitation is the absence of authentication support; all uploads are anonymous. This makes it ideal for public, unauthenticated image sharing use cases rather than private storage.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install node-upload-images"],"cli":null},"imports":["import { ImageUploadService } from 'node-upload-images';","import { ImageHostingService } from 'node-upload-images';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { ImageUploadService } from 'node-upload-images';\nimport * as fs from 'fs';\nimport * as path from 'path';\n\nasync function uploadExample() {\n  const service = new ImageUploadService('postimages.org');\n\n  // Create a dummy image file for demonstration\n  const dummyImagePath = path.join(process.cwd(), 'temp_test_image.png');\n  const dummyImageData = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=', 'base64');\n  fs.writeFileSync(dummyImagePath, dummyImageData);\n\n  try {\n    console.log('Attempting to upload from file...');\n    let { directLink: fileLink } = await service.uploadFromFile(dummyImagePath);\n    console.log(`Uploaded from file: ${fileLink}`);\n\n    console.log('Attempting to upload from binary data...');\n    let { directLink: binaryLink } = await service.uploadFromBinary(dummyImageData, 'binary_test.png');\n    console.log(`Uploaded from binary: ${binaryLink}`);\n\n    console.log('Attempting to upload from remote URL (using a placeholder image)...');\n    let { directLink: urlLink } = await service.uploadFromUrl('https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png');\n    console.log(`Uploaded from URL: ${urlLink}`);\n\n  } catch (error) {\n    console.error('Upload failed:', error.message);\n  } finally {\n    // Clean up the dummy file\n    if (fs.existsSync(dummyImagePath)) {\n      fs.unlinkSync(dummyImagePath);\n      console.log('Cleaned up dummy image file.');\n    }\n  }\n}\n\nuploadExample();","lang":"typescript","description":"Demonstrates uploading an image using all three supported methods: from a local file, from binary data, and from a remote URL. It also shows how to set up the `ImageUploadService`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}