https://github.com/fabioricali/loadim
Very simple module that detects when an image is loaded and returns it via callback
https://github.com/fabioricali/loadim
load-image load-image-asynchronously
Last synced: 9 months ago
JSON representation
Very simple module that detects when an image is loaded and returns it via callback
- Host: GitHub
- URL: https://github.com/fabioricali/loadim
- Owner: fabioricali
- License: mit
- Created: 2018-03-09T18:02:59.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-09T21:12:59.000Z (about 8 years ago)
- Last Synced: 2025-04-01T18:53:13.437Z (about 1 year ago)
- Topics: load-image, load-image-asynchronously
- Language: JavaScript
- Homepage:
- Size: 98.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# loadim
Very simple module that detects when an image is loaded and returns it via callback.
## Installation
```
npm install --save loadim
```
## Usage
```javascript
const loadim = require('loadim');
loadim('image.jpg', (err, image) => {
if(err)
throw err;
else
document.body.appendChild(image);
});
// CrossOrigin option
loadim('image.jpg', {crossOrigin: 'anonymous'}, (err, image) => {
if(err)
throw err;
else
document.body.appendChild(image);
});
```
## Changelog
You can view the changelog here
## License
loadim is open-sourced software licensed under the MIT license
## Author
Fabio Ricali