0.3.0 • Published 7 years ago

struda v0.3.0

Weekly downloads
44
License
MIT
Repository
-
Last release
7 years ago

struda

Structured data extraction from HTML.

import { parse } from 'struda';
const result = parse(window.document);
// {
//   "jsonld": {
//     "data": [ ... ],
//     "errors": []
//   },
//   "microformats": {
//     "data": {
//       "items": [ ... ],
//       "rels": { ... },
//       "rel-urls": { ... }
//     },
//     "errors": []
//   }
// }

Installation

npm install --save struda

Features

  • Performance: the data is parsed in a single traversal of the DOM
  • Parses jsonld and microformats (rdfa and microdata are planned)

Example

Use jsdom outside of the browser:

import { JSDOM } from 'jsdom';
import { parse } from 'struda';
const window = new JSDOM(`...`, { url: 'https://example.com/' })
const result = parse(window.document);
0.3.0

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago