1.0.11 • Published 10 years ago
fallback-image v1.0.11
fallback-image
Load a fallback image if an image errors out.
Installation
$ npm install fallback-imageUsage
import fallbackImage from 'fallback-image';
let imageEl = document.querySelector('img.horse-image');
fallbackImage(imageEl, './images/fallback-image.png');Standalone
Generate a standalone build in dist (for use with <script> tags and AMD module loaders):
$ npm run build:standaloneTest
Tests are done with tape by running:
$ npm test