1.0.1 • Published 5 years ago

simplecrawler-mongo-queue v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

MongoDB queue for Simplecrawler

npm Travis (.org) Dependency Status devDependency Status Greenkeeper badge

This is a queue implementation for simplecrawler powered by MongoDB.

Installation

npm install --save simplecrawler-mongo-queue

Usage

First of all, create a new Simplecrawler instance as described in the documentation. Then create the queue instance and assign it to crawler.queue property.

const Crawler = require('simplecrawler');
const MongoQueue = require('simplecrawler-mongo-queue');

(async () => {
  const crawler = new Crawler('http://example.com');
  crawler.queue = await MongoQueue.create(datastore, name);
  crawler.start();
})();

The create method returns MongoQueue instance and has two arguments:

  • datastore - the application should provide a MongoDB collection where the queue will be stored.
  • name (optional) - a name of the queue to distinguish the different crawlers. If the argument is omitted the constructor creates a random queue name.

Resources

1.0.1

5 years ago

1.0.0

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.0

6 years ago

0.0.0

6 years ago