@plurid/opject-client
TypeScript icon, indicating that this package has built-in type declarations

0.0.0-1 • Public • Published



License: DEL

opject

Object Passing Library

Contents

About

opject is a specification and implementation for passing objects through the network.

An object is a self-contained piece of code.

The passing of the object through the network is obtained in 2 steps:

  • a registered object is requested by the opject client from the opject server;
  • the opject client instantiates or runs in a virtual machine the received object.

opject has clients for

The opject server can serve any kind of object. However, depending on the preferred language, a specific opject server can be used for

The opject registry grants extended functionality through a web interface. The registry can be self-hosted or cloud-hosted.

Install

Install using

npm install @plurid/opject-client

or

yarn add @plurid/opject-client

Install the peer dependencies

@plurid/plurid-functions cross-fetch

Usage

The opject client requires a server. The server can be self-hosted or cloud-hosted.

The simplest use-case implies registering an opject, requiring, and running it.

import OpjectClient from '@plurid/opject-client';


const opjectClient = new OpjectClient({
    url: 'http://server.address',
    token: 'secret_token_obtained_from_server',
});

const opjectID = 'some-opject';

const opjectSource = `
class SomeOpject {
    internal = 12;

    read() {
        return this.internal;
    }
}
`;


const main = async () => {
    const registered = await opjectClient.register(
        opjectID,
        opjectSource,
    );

    if (!registered) {
        console.log('Opject not registered');
        return;
    }

    const someOpject = await opjectClient.require(
        opjectID,
    );

    const value = someOpject.read() // 12
}

main();

Packages

Version

@plurid/opject-client-javascriptJavaScript opject client

Version

@plurid/opject-server-javascriptJavaScript opject server

Version

@plurid/opject-client-pythonPython opject client

Version

@plurid/opject-server-pythonPython opject server

Readme

Keywords

Package Sidebar

Install

npm i @plurid/opject-client

Weekly Downloads

0

Version

0.0.0-1

License

SEE LICENSE IN LICENSE

Unpacked Size

52.4 kB

Total Files

15

Last publish

Collaborators

  • ly3xqhl8g9