# fallback-image

> Load a fallback image if an image errors out

Latest version **1.0.11** (published 2016-04-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install fallback-image
pnpm add fallback-image
yarn add fallback-image
bun add fallback-image
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.11 |
| Published | 2016-04-07 |
| First published | 2015-01-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Zak Angelle |
| Maintainers | zakangelle |
| Keywords | fallback, image, placeholder, 404, error |

## Links

- npm: https://www.npmjs.com/package/fallback-image
- Repository: https://github.com/zakangelle/fallback-image
- Issues: https://github.com/zakangelle/fallback-image/issues
- npm.io page: https://npm.io/package/fallback-image

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 1.0.11 (latest) — 2016-04-07
- 1.0.10 — 2016-04-07
- 1.0.9 — 2016-04-06
- 1.0.8 — 2015-01-22
- 1.0.7 — 2015-01-22
- 1.0.6 — 2015-01-21
- 1.0.5 — 2015-01-21
- 1.0.4 — 2015-01-21
- 1.0.3 — 2015-01-21
- 1.0.2 — 2015-01-21

## README

# fallback-image

Load a fallback image if an image errors out.

[![Build Status](https://travis-ci.org/zakangelle/fallback-image.svg?branch=master)](https://travis-ci.org/zakangelle/fallback-image)

## Installation

```
$ npm install fallback-image
```

## Usage

```js
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):

```sh
$ npm run build:standalone
```

## Test

Tests are done with [tape](https://github.com/substack/tape) by running:

```
$ npm test
```

---
_Source: https://npm.io/package/fallback-image · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
