# retrieve-all-images

> A function that retrieves all images for a given a webpage and outputs them, named as they are on the webpage, to the provided folder path. Note that the url should NOT include a trailing slash, as this can cause problems with how `srcset` paths are deter

Latest version **1.1.7** (published 2020-06-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install retrieve-all-images
pnpm add retrieve-all-images
yarn add retrieve-all-images
bun add retrieve-all-images
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.7 |
| Published | 2020-06-25 |
| First published | 2020-06-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 21.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Christopher Frewin |
| Maintainers | princefishthrower |

## Links

- npm: https://www.npmjs.com/package/retrieve-all-images
- Repository: https://github.com/princefishthrower/retrieve-all-images
- Homepage: https://github.com/princefishthrower/retrieve-all-images#readme
- Issues: https://github.com/princefishthrower/retrieve-all-images/issues
- npm.io page: https://npm.io/package/retrieve-all-images

## Dependencies (4)

- [puppeteer](https://npm.io/package/puppeteer.md) ^4.0.0
- [valid-url](https://npm.io/package/valid-url.md) ^1.0.9
- [@types/puppeteer](https://npm.io/package/@types/puppeteer.md) ^3.0.0
- [@types/valid-url](https://npm.io/package/@types/valid-url.md) ^1.0.3

## Recent versions

- 1.1.7 (latest) — 2020-06-25
- 1.0.7 — 2020-06-24
- 1.0.6 — 2020-06-24
- 1.0.5 — 2020-06-24
- 1.0.4 — 2020-06-24
- 1.0.3 — 2020-06-24
- 1.0.2 — 2020-06-24
- 1.0.1 — 2020-06-24
- 1.0.0 — 2020-06-24

## README

# retrieve-all-images

A function that retrieves all images for a given a webpage and outputs them, named as they are on the webpage, to the provided folder path. Note that the url should NOT include a trailing slash, as this can cause problems with how `srcset` paths are determined, if they are provided as a relative path on the desired retrieval page.

## TypeScript Usage:

```typescript
import { retrieveAllImages } from 'retrieve-all-images';
import path from 'path';

// retrieves all images present on CNN homepage to folder in project root folder under output-images/
// also prints out the objects returned which includes the src used to download, the base filename, and the alt
async function test() {
  const retrievedImageInfos = await retrieveAllImages(
    "https://edition.cnn.com",
    path.join(__dirname, "..", "output-images")
  );
  console.log(
    "Done with image retrieval. Retrieved image data: " +
      JSON.stringify(retrievedImageInfos)
  );
}

test();
```

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