# ${pkg.name} ${badge('npm')} ${badge('license')} ${badge('github-issues')} ${badge('nodei')} ${pkg.description} ## Features - load a bunch of urls and notify progress via a promise - store these urls binary content as base64 - fallback to original url when image not found in cache :warning: As images are downloaded via AJAX, the remote urls must have [CORS enabled](http://enable-cors.org) ## QuickStart ```js import imagesCache from 'images-cache'; const images = [ 'http://path/to/image.jpg', 'http://path/to/image2.jpg' ]; imagesCache.load(images).progress(status => { console.log('progress', status.loaded, status.total); }).then(() => { imagesCache.get('http://path/to/image.jpg'); // -> returns the base64 version, ex: data:image/jpg;base64,... imagesCache.get('http://path/to/unknown/image.jpg'); // -> returns 'http://path/to/unknown/image.jpg' }).done(); ``` ## API - `load(urls)`: load a bunch of urls and store internally as base64. - `get(url)`: return base64 version of an existing url, and return original url if not found in cache - `clear()`: empty the current cache ## Scripts ${scripts()} ## Dependencies ${dependencies()} ## Author ${author()} ## License ${license()}