# raspar

> A simple to use Promise-based web scraper with local caching.

Latest version **5.0.0** (published 2024-06-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install raspar
pnpm add raspar
yarn add raspar
bun add raspar
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2024-06-04 |
| First published | 2016-06-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | 20.x |
| Dependencies | 1 |
| Unpacked size | 18.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | neogeek |
| Keywords | request, cache, promise |

## Links

- npm: https://www.npmjs.com/package/raspar
- Repository: https://github.com/neogeek/raspar
- Issues: https://github.com/neogeek/raspar/issues
- npm.io page: https://npm.io/package/raspar

## Dependencies (1)

- [node-fetch](https://npm.io/package/node-fetch.md) 3.3.2

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 5.0.0 (latest) — 2024-06-04
- 4.0.0 — 2024-06-04
- 3.0.2 — 2022-03-08
- 3.0.1 — 2022-03-06
- 3.0.0 — 2022-03-05
- 2.1.0 — 2020-09-11
- 2.0.0 — 2019-11-13
- 1.1.2 — 2017-08-24
- 1.1.1 — 2017-03-11
- 1.1.0 — 2016-12-20
- 1.0.2 — 2016-12-06
- 1.0.1 — 2016-10-06
- 1.0.0 — 2016-06-19

## README

# raspar

> A simple to use Promise-based web scraper with local caching.

[![Tests](https://github.com/neogeek/raspar/actions/workflows/test.workflow.yml/badge.svg)](https://github.com/neogeek/raspar/actions/workflows/test.workflow.yml)
[![NPM Version](http://img.shields.io/npm/v/raspar.svg?style=flat)](https://www.npmjs.org/package/raspar)
[![Latest Documentation](https://doxdox.org/images/badge-flat.svg)](https://doxdox.org/)

## Usage

```javascript
import fetch from 'raspar';

const contents = await fetch('http://www.google.com/humans.txt');

console.log(contents);
```

### Options

```javascript
import fetch from 'raspar';

const options = {
  cacheDirectory: 'temp/cache/',
  requestOptions: {
    headers: {
      'User-Agent': 'request'
    },
    method: 'POST'
  },
  ttl: 1800
};

const contents = await fetch('http://www.google.com/humans.txt', options);

console.log(contents);
```

| Name           | Description                                                                                                                     | Default Value |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| cacheDirectory | Directory to store cache.                                                                                                       | `temp/cache/` |
| requestOptions | Request options object. [Read more github.com/node-fetch/node-fetch](https://github.com/node-fetch/node-fetch/tree/2.x#options) | `{}`          |
| ttl            | TTL (Time to live) in seconds.                                                                                                  | `1800`        |

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