What is a Driver?link

A program that has the sole purpose of talking to an API and exposing its data and functionality on its graph. In other words, drivers are API connectors.

What if there's no driver for an APIlink

You can always use fetch, it's a global function. However, fetch is implemented as a thin layer on top of the http program, so any program that uses fetch must have http as a dependency.

Differences with Node.jslink

Even though Membrane programs are written in TypeScript/JavaScript, they work differently from a typical Node.js or browser programs in a couple of fundamental ways:

  1. Membrane programs are durable
    • There's no need to store data in external databases or files. Use the state object instead
    • Actions can run indefinitely (e.g. await'ing an email reply)
  2. Membrane programs are event-sourced
    • each program lives in a self-contained SQLite file that stores events in a write-ahead log. Which means that you can always tell what happened across all of your programs. If it's not in the log, it didn't happen.
  3. All communication happens through the graph
    • Even fetch is implemented using graph nodes

Do NPM modules work?link

Many NPM modules can be used in membrane but not all of them, especially if they depend on specific Node.js APIs. We strive to provide a compatibility layer but it's still work-in-progress.

...
...