Socket
Book a DemoInstallSign in
Socket

@brechtvdv/actor-init-ldes-client

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brechtvdv/actor-init-ldes-client

An init actor that fetches members from an Event Stream API

1.19.1
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

@brechtvdv/actor-init-ldes-client

Fetches fragments of a TREE Event Stream and emits its data (in the future: members) when a fragment's caching headers has been invalidated In order to avoid receiving duplicate members, we will create in the future a tool filters members by storing it.

Install

npm install -g @brechtvdv/actor-init-ldes-client

In order to use it as a library, you can leave out the -g.

How to use it

Usage from the command line

actor-init-ldes-client --pollingInterval 10000 https://lodi.ilabt.imec.be/coghent/industriemuseum/objecten

Usage within application

The easyest way to create an engine (with default config) is as follows:

const newEngine = require('@brechtvdv/actor-init-ldes-client').default;

const LDESClient =  newEngine();

With the engine or client created, you can now use it to call te async createReadStream(url, options) method. Here is an example synchronizing with a TREE root node of an Event Stream with polling interval of 5 seconds:

  try {
    let url = "https://lodi.ilabt.imec.be/coghent/industriemuseum/objecten";
    let options = {
      "pollingInterval": 5000 // millis
    };
    let eventstreamSync = LDESClient.createReadStream(url, options);
    eventstreamSync.on('data', (data) => {
      console.log(data)
    });
    eventstreamSync.on('end', () => {
      console.log("No more data!")
    });
  } catch (e) {
    console.error(e);
  }

FAQs

Package last updated on 15 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.