# crawl-sitemap

> Crawl to discover all URL locations defined in a sitemap or sitemap index

Latest version **1.0.1** (published 2020-10-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install crawl-sitemap
pnpm add crawl-sitemap
yarn add crawl-sitemap
bun add crawl-sitemap
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-10-24 |
| First published | 2020-10-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=12 |
| Dependencies | 3 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Andrew Duthie |
| Maintainers | aduth |

## Links

- npm: https://www.npmjs.com/package/crawl-sitemap
- Repository: https://github.com/aduth/crawl-sitemap
- Issues: https://github.com/aduth/crawl-sitemap/issues
- npm.io page: https://npm.io/package/crawl-sitemap

## Dependencies (3)

- [saxophonist](https://npm.io/package/saxophonist.md) ^2.0.0
- [http-or-https](https://npm.io/package/http-or-https.md) ^1.0.2
- [decompress-response](https://npm.io/package/decompress-response.md) ^6.0.0

## Recent versions

- 1.0.1 (latest) — 2020-10-24
- 1.0.0 — 2020-10-18

## README

# crawl-sitemap

Crawl to discover all URL locations defined in a sitemap or sitemap index.

## Example

```js
import crawl from 'crawl-sitemap';

for await (const url of crawl('https://andrewduthie.com/sitemap.xml')) {
	console.log(url);
}

// → https://andrewduthie.com/2019/11/29/back-to-basics-a-possible-future-without-javascript-build-tools/
// → https://andrewduthie.com/2020/03/15/typescript-types-for-productivity/
// → https://andrewduthie.com/2019/12/22/font-loading-performance-for-single-page-applications/
// ...
```

## Installation

`crawl-sitemap` is authored as an [ESM module](https://nodejs.org/api/esm.html), and therefore requires Node 12.0 or newer.

Install using NPM or Yarn:

```
npm install crawl-sitemap
```

```
yarn add crawl-sitemap
```

## Usage

The default export will return an async generator when called, which can be iterated asynchronously with `for await` to operate on crawled links as soon as they're discovered:

```js
for await (const url of crawl('https://andrewduthie.com/sitemap.xml')) {
	console.log(url);
}
```

## API

```ts
function crawl(url: string): AsyncGenerator<string>;
```

## License

Copyright 2020 Andrew Duthie

Released under the MIT License. See [LICENSE.md](./LICENSE.md).

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