A helper that build a x-ray based on a schema.
npm install x-ray-build
const x = require('x-ray');
const build = require('x-ray-build');
const drive = x();
const crawl = build(drive, {
$source: 'https://github.com/diogoazevedos',
$context: '[itemscope]',
$selector: {
name: '.vcard-fullname',
repos: {
$context: '.source',
$selector: [{
name: '.repo',
}],
},
},
});
crawl((e, content) => console.log(content));