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.
npm install node-upload-imagesVerified import paths — ran on the pinned version, not inferred.
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`.
For private or managed image storage, consider alternative solutions or use this library only for temporary, public-facing content.
Implement robust error handling around upload calls and consider monitoring the upstream services for changes. For critical applications, self-hosting or paid services are more reliable.
Monitor `upload.cc` functionality periodically if you heavily depend on it. Be prepared for potential upload failures and consider reporting issues to the library maintainers or using alternative hosts.
Ensure the `host` string exactly matches one of the supported services (e.g., 'new.fastpic.org', 'pixhost.to', 'postimages.org', 'upload.cc').
Use ES Module `import` syntax: `import { ImageUploadService } from 'node-upload-images';` and ensure your Node.js environment or build setup supports ES Modules (e.g., by setting `"type": "module"` in `package.json` or using a bundler like Webpack/Rollup).Double-check the file path. Use absolute paths (`path.resolve(__dirname, 'test.png')`) or ensure the relative path is correct from where your script is executed.