Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/diogoazevedos/x-ray-build

A helper that build a x-ray based on a schema
https://github.com/diogoazevedos/x-ray-build

crawler schema scraper structure x-ray

Last synced: 6 days ago
JSON representation

A helper that build a x-ray based on a schema

Awesome Lists containing this project

README

        

# x-ray-build
[![Build Status](https://travis-ci.org/diogoazevedos/x-ray-build.svg?branch=master)](https://travis-ci.org/diogoazevedos/x-ray-build)
[![Coverage Status](https://coveralls.io/repos/github/diogoazevedos/x-ray-build/badge.svg)](https://coveralls.io/github/diogoazevedos/x-ray-build)

A helper that build a [x-ray](https://github.com/lapwinglabs/x-ray) based on a schema.

### Getting started

```sh
npm install x-ray-build
```

```js
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));
```