# imgz

> Tiny image sources loader

Latest version **0.0.2** (published 2018-09-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install imgz
pnpm add imgz
yarn add imgz
bun add imgz
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2018-09-23 |
| First published | 2018-09-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jose Luis Quintana |
| Maintainers | joseluisq |
| Keywords | image, loader, lazy-load |

## Links

- npm: https://www.npmjs.com/package/imgz
- Repository: https://github.com/joseluisq/imgz
- Homepage: https://github.com/joseluisq/imgz#readme
- Issues: https://github.com/joseluisq/imgz/issues
- npm.io page: https://npm.io/package/imgz

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2018-09-23
- 0.0.1 — 2018-09-22

## README

# Imgz [![npm](https://img.shields.io/npm/v/imgz.svg)](https://www.npmjs.com/package/imgz) [![npm](https://img.shields.io/npm/dt/imgz.svg)](https://www.npmjs.com/package/imgz) [![Build Status](https://travis-ci.org/joseluisq/imgz.svg?branch=master)](https://travis-ci.org/joseluisq/imgz) [![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)

> Tiny image sources loader. :framed_picture:

## Install

[Yarn](https://github.com/yarnpkg/)

```sh
yarn add imgz
```

[NPM](https://www.npmjs.com/)

```sh
npm install imgz --save
```

The [UMD](https://github.com/umdjs/umd) and style builds are also available on [unpkg](https://unpkg.com).

```html
<link rel="stylesheet" href="https://unpkg.com/imgz/dist/imgz.min.css">
```

You can use the component via `window.imgz`

## Usage

```ts
import { Loader } from 'imgz'

const images = [
  'https://i.imgur.com/G5MR088.png',
  'http://server/not-found-image.png',
  'https://i.imgur.com/G5MR088.png'
]

Loader (images, (image, index, event) => console.log('Image loaded:', image))
```

## API

```ts
Loader (
  // Sources
  source: string | string[],
  // Source loaded
  (image: HTMLImageElement | null, index: number, event: LoadEvent | ErrorEvent) => void,
  // Sources completed (optional)
  (length: number) => void
)
```

See [index.d.ts](./index.d.ts) for more details.

## Contributions

[Pull requests](https://github.com/joseluisq/imgz/pulls) or [issues](https://github.com/joseluisq/imgz/issues) are very appreciated.

## License
MIT license

© 2018 [José Luis Quintana](http://git.io/joseluisq)

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