Interface

Spawner

Spawner

Rules for generating a new Task from url and taskMeta.

x.spawner({
 regex: /forum\/page-\d+/,
 spawn: (url, meta)=>({
   url,
   parse: "title",
   callback(task){
     console.log(task.res.statusCode);
   }
 })
})

x("http://example.com/forum/page-2", {metakey:'metavalue'})

View Source index.ts, line 70

Members

RegExp

# regex Optional

Regex expression for validating urls.

View Source index.ts, line 88

function

# spawn Optional

Spawn function should return a task object.

View Source index.ts, line 100

function

# validator Optional

Direct function for validating urls.

View Source index.ts, line 94