Load one or more images in the browser and return a promise, with support for custom attributes.
image-promise is a lightweight JavaScript library that provides promise-based image loading for the browser. It allows developers to load one or multiple images asynchronously, handling both URLs and existing HTML image elements with a simple API.
Frontend developers who need reliable asynchronous image loading in web applications, particularly those working with canvas, galleries, or dynamic content.
Its tiny size (0.5KB), zero dependencies, and simple promise-based API make it an attractive alternative to manual image loading or larger utility libraries.
🎑🤞 Load one or more images, return a promise. Tiny, browser-only, no dependencies.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
At only 0.5KB gzipped with zero dependencies, it adds minimal overhead and is easy to integrate into lightweight web projects.
Replaces manual onload/onerror event handlers with a clean promise API, simplifying asynchronous image loading in JavaScript code.
Accepts strings, <img> elements, NodeLists, or jQuery objects, allowing it to work with diverse codebases and image sources.
Enables setting attributes like crossorigin before loading, which is crucial for CORS-enabled images in canvas operations.
The library is officially deprecated in favor of native img.decode(), meaning no future updates, bug fixes, or official support.
Only handles basic loading; lacks advanced capabilities like error recovery, progress tracking, or integration with modern frontend frameworks.
Cannot be used in Node.js or server-side environments, limiting its utility in universal JavaScript or SSR applications.