Chck Imgs
chckImgs
is a lightweight (< 400 bytes gzipped) JavaScript plugin to check if one or multiple images are loaded.
Install
NPM
npm install --save chck-imgs
Bower
bower install --save chck-imgs
Usage
/** * `chckImgs` will always resolve with an array, even if one or multiple images failed to load. * You can loop through this array and check the `status` (`ok` or `error`) for each image * * @param * @return {Promise.<{{path: String, status: String}}>} */ ;
Browser Support
All major browsers are supported (IE9+). You'll have to polyfill ES6 Promises
for browsers that do not support native Promises yet.
Local Development
To compile and compress chckImgs.js
, we rely on npm as a Build Tool.
Setup
-
Check out the repository
git clone git@github.com:mrksbnch/chck-imgs.gitcd chck-imgs -
Run
npm install
to install all dependencies
Workflow
NPM command | Description |
---|---|
npm run lint |
(es)lint JavaScript |
npm run uglify |
Compress JavaScript |
npm run babel |
Compile ES6 to ES5 with Babel |
npm run build |
Lint, compress and minify JavaScript |
npm run watch |
Watch file changes |
Copyright
Copyright 2016 Markus Bianchi. See LICENSE for details.