Skip to content

Very simple module that detects when an image is loaded and returns it via callback

License

Notifications You must be signed in to change notification settings

fabioricali/loadim

Repository files navigation

loadim

Very simple module that detects when an image is loaded and returns it via callback.





Installation

npm install --save loadim

Usage

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

About

Very simple module that detects when an image is loaded and returns it via callback

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published