struda

0.3.0 • Public • Published

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

/struda/

    Package Sidebar

    Install

    npm i struda

    Weekly Downloads

    2

    Version

    0.3.0

    License

    MIT

    Unpacked Size

    321 kB

    Total Files

    8

    Last publish

    Collaborators

    • woorank-admin
    • ndemoor
    • woorank-ci