raspar

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

MIT License

Downloads
12
Stars
1

raspar

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

Usage

import fetch from 'raspar';

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

console.log(contents);

Options

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 {}
ttl TTL (Time to live) in seconds. 1800
Package Rankings
Top 11.02% on Npmjs.org
Badges
Extracted from project README
Tests NPM Version Latest Documentation