3.0.2 • Published 2 years ago

raspar v3.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
2 years ago

raspar

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

Tests NPM Version Latest Documentation

Usage

const { fetch } = require('raspar');

fetch('http://www.google.com/humans.txt').then(content => console.log(content));
const { fetch } = require('raspar');

fetch([
  'http://www.google.com/humans.txt',
  'http://www.google.com/robots.txt'
]).then(content => console.log(content[0]));

Options

const { fetch } = require('raspar');

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

fetch('http://www.google.com/humans.txt', options).then(content =>
  console.log(content)
);
NameDescriptionDefault Value
cacheDirectoryDirectory to store cache.temp/cache/
requestOptionsRequest options object. Read more github.com/node-fetch/node-fetch{}
ttlTTL (Time to live) in seconds.1800
3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.1.0

4 years ago

2.0.0

5 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

8 years ago

1.0.0

8 years ago