Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

brayns

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brayns

> A JavaScript/TypeScript interface for interacting with the [Brayns](https://github.com/BlueBrain/Brayns) rendering service.

  • 0.8.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

Brayns JavaScript/TypeScript Client

A JavaScript/TypeScript interface for interacting with the Brayns rendering service.

Table of Contents

Installation


You can install this package from NPM:

npm add rxjs rockets-client brayns

Or with Yarn:

yarn add rxjs rockets-client brayns

NOTE: TypeScript type definitions are bundled with the package.

Usage


Create a client and connect:

import {Client} from 'brayns';
import {take} from 'rxjs/operators';

const brayns = new Client('myhost');
await brayns.ready.pipe(take(1))
    .toPromise();

Listen to server notifications:

import {Client, PROGRESS} from 'brayns';

const brayns = new Client('myhost');

brayns.observe(PROGRESS)
    .subscribe(progress => {
        console.log(progress);
    });

Send notifications:

import {CANCEL, Client} from 'brayns';

const brayns = new Client('myhost');
await brayns.ready.pipe(take(1))
    .toPromise();

brayns.notify(CANCEL, {
    id: 1 // some request id
});

Make a request:

import {Client, GET_STATISTICS} from 'brayns';

const brayns = new Client('myhost');
await brayns.ready.pipe(take(1))
    .toPromise();

const statistics = await brayns.request(GET_STATISTICS);
console.log(statistics);

Upload a model:

import {Client} from 'brayns';

const brayns = new Client('myhost');
await brayns.ready.pipe(take(1))
    .toPromise();

// Usually we get the file from user input
const file = new File([]);

await brayns.upload({file});

FAQs

Package last updated on 26 Feb 2019

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc