# image-loaded

> Call a callback when an image has loaded - adapted from desandro/imagesloaded

Latest version **0.0.2** (published 2013-04-04) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2013-04-04 |
| First published | 2013-04-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Hugh Kennedy |
| Maintainers | hughsk |
| Keywords | images, loaded, browserify, detect |

## Links

- npm: https://www.npmjs.com/package/image-loaded
- Repository: https://github.com/hughsk/image-loaded
- npm.io page: https://npm.io/package/image-loaded

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2013-04-04
- 0.0.1 — 2013-04-04

## README

# image-loaded #

[![browser support](https://ci.testling.com/hughsk/image-loaded.png)](https://ci.testling.com/hughsk/image-loaded)

Call a callback when an image has loaded - adapted from
[desandro/imagesloaded](https://github.com/desandro/imagesloaded),
minus the jQuery.

## Installation ##

Using [npm](http://npmjs.org/) and [browserify](http://browserify.org/):

``` bash
npm install image-loaded
```

## Usage ##

**require('image-loaded')(image, callback)**

``` javascript
var loaded = require('image-loaded')
var image = document.getElementById('hidden-image')

loaded(image, function(err, alreadyLoaded) {
  // image is loaded!
})
```

If the image was already loaded beforehand, the callback will be called
instantly with the second argument set to `true`. Otherwise this will be
`false`.

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