This is a simple images loader utility.
Any pull request for optimisations and new additions is more than welcome.
npm install vanilla-image-loader
or
yarn add vanilla-image-loader
import loadImage from 'vanilla-image-loader';
loadImage('path/to/image')
.then(({ width, height }) => {
console.log(width, height);
})
.catch((error) => {
console.log(error);
};