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

@casual-simulation/aux-vm-client

Package Overview
Dependencies
Maintainers
2
Versions
453
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@casual-simulation/aux-vm-client

A set of utilities required to securely run an AUX as a client.

  • 2.0.36
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16
decreased by-96.69%
Maintainers
2
Weekly downloads
 
Created
Source

AUX VM Client

npm (scoped)

A set of utilities required to run an AUX as a client.

Installation

npm install @casual-simulation/aux-vm-client

Usage

Create a custom channel implementation
import { RemoteAuxChannel } from '@casual-simulation/aux-vm-client';
import { AuxUser, AuxConfig } from '@casual-simulation/aux-vm';

export class MyCustomChannel extends RemoteAuxChannel {

    constructor(defaultHost: string, user: AuxUser, config: AuxConfig) {
        super(defaultHost, user, config, {});
    }

    // Override the _handleServerEvents function
    // to handle events sent from a remote device.
    protected async _handleServerEvents(events: DeviceAction[]) {
        await super._handleServerEvents(events);
        let filtered = events.filter(
            e => e.device.roles.indexOf(SERVER_ROLE) >= 0
        );
        let mapped = <BotAction[]>filtered.map(e => e.event);
        if (filtered.length > 0) {
            await this.sendEvents(mapped);
        }
    }
}

Keywords

FAQs

Package last updated on 04 Feb 2022

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