2.1.2 • Published 7 years ago

the-crawler-base v2.1.2

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

the-crawler-base

Build Status npm Version JS Standard

Base of the-crawlers

Installation

$ npm install the-crawler-base --save

Usage

'use strict'

const { TheCrwl } = require('the-crawler-base')
const theDB = require('the-db')

async function tryExample () {
  let db = theDB({ /* ... */ })

  class MyCrwl extends TheCrwl {
    async crawl (config = {}) {
      /* ... */
      return [
        { resource: 'Site', id: 1, attributes: { /* ... */ } },
        { resource: 'Article', id: 1, attributes: { /* ... */ } }
      ]
    }
  }

  let crwl = new MyCrwl({})
  crwl.setResource('Site', db.resource('Site'))
  crwl.setResource('Article', db.resource('Article'))

  /* ... */
}

tryExample().catch((err) => console.error(err))

API Guide

License

This software is released under the MIT License.

Links

2.1.2

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago