# xhr-image

> XHR-driven Images for progress events

Latest version **0.0.1** (published 2013-06-28) · MIT license · 0 weekly downloads

## Install

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

## 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.1 |
| Published | 2013-06-28 |
| First published | 2013-06-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | tjholowaychuk |
| Keywords | url, utility |

## Links

- npm: https://www.npmjs.com/package/xhr-image
- npm.io page: https://npm.io/package/xhr-image

## Dependencies (1)

- [emitter-component](https://npm.io/package/emitter-component.md) *

## Recent versions

- 0.0.1 (latest) — 2013-06-28

## README

# xhr-image

  XHR-driven `Image` for progress events.

## Installation

  Install with [component(1)](http://component.io):

    $ component install component/xhr-image

## Example

```js
var XHRImage = require('xhr-image');

var img = new XHRImage('http://i.cloudup.com/0chKjveyrS.png');

img.on('progress', function(e){
  progress.style.width = (e.percent | 0) + '%';
});

img.on('load', function(){
  var el = new Image;
  el.src = URL.createObjectURL(img.xhr.response);
  document.body.appendChild(el);
});
```

## Events

 - `open`
 - `sent`
 - `receiving`
 - `load`
 - `progress`

## API

### Image(src)

  Request the given img `src`.

### .xhr

  The XHR request.

### .abort()

  Abort the request.

## License

  MIT

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