# html-img-digger

> Img elements as plain-object extract from html-string.

Latest version **0.1.0** (published 2015-07-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install html-img-digger
pnpm add html-img-digger
yarn add html-img-digger
bun add html-img-digger
```

## 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.1.0 |
| Published | 2015-07-01 |
| First published | 2015-07-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | no |
| Author | Pleasurazy |
| Maintainers | pleasurazy |

## Links

- npm: https://www.npmjs.com/package/html-img-digger
- npm.io page: https://npm.io/package/html-img-digger

## Dependencies (4)

- [cheerio](https://npm.io/package/cheerio.md) ^0.19.0
- [request](https://npm.io/package/request.md) ^2.58.0
- [image-size](https://npm.io/package/image-size.md) ^0.3.5
- [request-promise](https://npm.io/package/request-promise.md) ^0.4.2

## Recent versions

- 0.1.0 (latest) — 2015-07-01

## README

# html-img-digger

## Usage

#### Basic

```js
import digger from 'html-img-digger'

let tpl = '<div><img src="http://placehold.it/350x150"></div>'
let images = digger.dig(tpl)
```

> images

```js
[
  {
    url: 'http://placehold.it/350x150',
    alt: '',
  },
]
```

#### Download remote images (size digs, but slower)

```js
let tpl = '<div><img src="http://placehold.it/350x150"></div>'
let images = digger.dig(tpl, { remote: true })
```

> images

```js
[
  {
    url: 'http://placehold.it/350x150',
    alt: '',
    width: 350,
    height: 150,
  },
]
```

## Development

```sh
npm run dev
```

## Test

```sh
npm test
```

```
dig()
  ✓ 從傳入的 htmlString 中，採集出 img 物件們
  ✓ 允許遠端採集圖片寬與高（using http request） (651ms)
```

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