datex2-linker-api

0.3.1 • Public • Published

Datex II linker API

This is the API used in datex2-linker.

Build Status npm version

Usage

import parse from 'datex2-linker-api';
 
/**
 * Parse a xml datex2 feed into a json-ld feed
 * @param  {string} source  a valid URL that goes to an xml datex2 feed
 * @param  {string} baseuri the baseuri that contains each identifier (as a hash)
 * @param  {[object]} sourceOptions any of the `http.request` options.
 * @return {Promise}        will return the json-ld once parsing has completed
 */
parse(source, baseuri, sourceOptions).then(res=>{
  console.log(res); // an object with the same value as the original xml
}).catch(err=>{
  console.error(err); // 'error while parsing xml. ...'
});

License

© 2016 - Open Knowledge Belgium - iMinds — Haroen Viaene and contributors

Licensed under the Apache 2.0 license.

/datex2-linker-api/

    Package Sidebar

    Install

    npm i datex2-linker-api

    Weekly Downloads

    8

    Version

    0.3.1

    License

    Apache-2.0

    Unpacked Size

    180 kB

    Total Files

    9

    Last publish

    Collaborators

    • haroenv