# image-url-data

> Scrape image urls from HTML website including CSS background images.

Latest version **1.0.5** (published 2020-12-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install image-url-data
pnpm add image-url-data
yarn add image-url-data
bun add image-url-data
```

## 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 | 1.0.5 |
| Published | 2020-12-08 |
| First published | 2020-12-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | pavel |
| Maintainers | pavel1860 |
| Keywords | scraping, web-crawler, images, size |

## Links

- npm: https://www.npmjs.com/package/image-url-data
- Repository: https://github.com/pavel1860/get-url-images
- Homepage: https://github.com/vorg/pex-geom.git
- Issues: https://github.com/pavel1860/get-url-images/issues
- npm.io page: https://npm.io/package/image-url-data

## Dependencies (2)

- [bluebird](https://npm.io/package/bluebird.md) ^2.3.10
- [phantomjs](https://npm.io/package/phantomjs.md) ^2.1.7

## 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

- 1.0.5 (latest) — 2020-12-08

## README

#get-image-urls

Scrape image urls from a HTML website.

It's using [PhantomJS](http://phantomjs.org) in the background to get all images including CSS backgrounds.

based on get-image-urls repository. returning the size of the image!

<!-- ## Installation -->

<!-- ```
npm install get-image-urls
``` -->

## Usage

Import

```javascript
var getImageUrls = require('get-image-urls');
```

API

```javascript
getImageUrls(url, [callback]) //returns Promise
```

Result

```javascript
[
	{ contentType: 'image/png', url: 'http://example.com/bg.png' },
	{ contentType: 'image/jpeg', url: 'http://example.com/picture.jpg' }
]
```

## Example

With NodeJS callback

```javascript
var getImageUrls = require('get-image-urls');

getImageUrls('http://google.com', function(err, images) {
  if (!err) {
    console.log('Images found', images.length);
    console.log(images);
  }
  else {
    console.log('ERROR', err);
  }
})
```

With returned Promise

```javascript
var getImageUrls = require('get-image-urls');

getImageUrls('http://google.com')
.then(function(images) {
  console.log('Images found', images.length);
  console.log(images);
})
.catch(function(e) {
  console.log('ERROR', e);
})
```

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