Xray(...).abort is not a function #134

Closed
opened 2025-10-14 18:14:25 -06:00 by navan · 0 comments
Owner

Originally created by @Raidus on 8/7/2017

Subject of the issue

The documentation says that the abort method accepts a callback function with two arguments. I've tried a minimal example but it didn't work. I'm not sure how to use the "abort" function.

Could someone provide a minimal example how to use this function?

I've tried following code to understand the abort method but I'm getting an error.

'use strict';

var Xray = require('x-ray');
var x = Xray().abort((result, next) => {
  console.log('result', result);
  console.log('next', next);
  return false;
});

x('https://dribbble.com', 'li.group', [
  {
    title: '.dribbble-img strong',
    image: '.dribbble-img [data-src]@data-src'
  }
])
  .paginate('.next_page@href')
  .limit(3)
  .write('results.json');

Error:

Error TypeError: Xray(...).abort is not a function

My environment

  • version of node: 8.2.1
  • version of npm: 5.2.0
*Originally created by @Raidus on 8/7/2017* ### Subject of the issue The documentation says that the abort method accepts a callback function with two arguments. I've tried a minimal example but it didn't work. I'm not sure how to use the "abort" function. Could someone provide a minimal example how to use this function? I've tried following code to understand the abort method but I'm getting an error. ```javascript 'use strict'; var Xray = require('x-ray'); var x = Xray().abort((result, next) => { console.log('result', result); console.log('next', next); return false; }); x('https://dribbble.com', 'li.group', [ { title: '.dribbble-img strong', image: '.dribbble-img [data-src]@data-src' } ]) .paginate('.next_page@href') .limit(3) .write('results.json'); ``` Error: ```javascript Error TypeError: Xray(...).abort is not a function ``` ### My environment * version of node: 8.2.1 * version of npm: 5.2.0
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github/x-ray#134
No description provided.