# @f/load-image

> Load an image in the browser to ensure it is available to be rendered immediately

Latest version **2.0.0** (published 2016-06-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @f/load-image
pnpm add @f/load-image
yarn add @f/load-image
bun add @f/load-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 | 2.0.0 |
| Published | 2016-06-03 |
| First published | 2016-06-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | f |

## Links

- npm: https://www.npmjs.com/package/@f/load-image
- Repository: https://github.com/micro-js/load-image
- Homepage: https://github.com/micro-js/load-image#readme
- Issues: https://github.com/micro-js/load-image/issues
- npm.io page: https://npm.io/package/@f/load-image

## Recent versions

- 2.0.0 (latest) — 2016-06-03
- 1.0.0 — 2016-06-03

## README

# load-image

[![Build status][travis-image]][travis-url]
[![Git tag][git-image]][git-url]
[![NPM version][npm-image]][npm-url]
[![Code style][standard-image]][standard-url]

Load an image in the browser to ensure it is available to be rendered immediately

## Installation

    $ npm install @f/load-image

## Usage

```js
var loadImage = require('@f/load-image')

function allImagesLoaded () {
  return Promise.all(
  [].slice.call(document.querySelectorAll('img')).map(img => loadImage(img.getAttribute('src')))
}
```

## API

### loadImage(url)

- `url` - Url of the image you want to load

**Returns:** A promise that resolves when the image is loaded or rejects if an error occurs.

## License

MIT

[travis-image]: https://img.shields.io/travis/micro-js/load-image.svg?style=flat-square
[travis-url]: https://travis-ci.org/micro-js/load-image
[git-image]: https://img.shields.io/github/tag/micro-js/load-image.svg?style=flat-square
[git-url]: https://github.com/micro-js/load-image
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[standard-url]: https://github.com/feross/standard
[npm-image]: https://img.shields.io/npm/v/@f/load-image.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@f/load-image

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