npm.io
5.0.0 • Published 2 years ago

onedionys-image-loading-utilities

Licence
ISC
Version
5.0.0
Deps
132
Size
13 kB
Vulns
0
Weekly
0
Stars
8

Welcome to One Dionys - Image Loading Utilities!

Functions for loading and manipulating images in web applications.

Requirements

  • Web Browser - Can be used as an emulator to build applications. Example [Chrome, Firefox, Safari & Opera].
  • Internet - Because many use CDN and to make it easier to find solutions to all problems.

How To Use

Example Syntax
const { loadImage } = require('image-loading-utilities');

// Example usage
const imageUrl = 'https://example.com/image.jpg';

loadImage(imageUrl)
.then(image => {
    console.log('Image loaded successfully:', image);
})
.catch(error => {
    console.error('Error loading image:', error);
});
Explanation
  • This package provides a single function loadImage(url) to asynchronously load an image from a given URL. It returns a Promise that resolves with the loaded image or rejects with an error if the image fails to load.
Return Value
  • When the image is successfully loaded, the Promise resolves with the loaded Image object.
  • If the image fails to load (e.g., due to an invalid URL or network error), the Promise rejects with an Error object.

Release Date

  • v1.0.0 : 07 March 2024
  • v1.0.1 : 11 March 2024
  • v4.0.0 : 11 March 2024
  • v4.0.1 : 13 March 2024
  • v4.0.2 : 18 March 2024
  • v5.0.0 : 31 March 2024

Author

License

  • Copyright 2024 One Dionys
  • One Dionys - Image Loading Utilities is an open source project licensed under the MIT license

Suppport & Donation

Love One Dionys - Image Loading Utilities? Support this project by donating or sharing with others in need.

Made with One Dionys

Keywords