npm.io
1.0.0 • Published 8 years ago

loadim

Licence
MIT
Version
1.0.0
Deps
0
Size
36 kB
Vulns
0
Weekly
0

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

Keywords