Socket
Book a DemoInstallSign in
Socket

alice-bob

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alice-bob

transport agnostic strongly typed duplex rpc interfaces

2.0.0
latest
Source
npmnpm
Version published
Weekly downloads
20
185.71%
Maintainers
1
Weekly downloads
 
Created
Source

alice-bob

transport agnostic strongly typed duplex rpc interfaces

npm i alice-bob pnpm add alice-bob yarn add alice-bob

API

# Alice – Alice class. src/alice-bob.ts#L292

    # constructor(send, target) – Creates an instance of Alice. src/alice-bob.ts#L297
    # local – The local Agent. src/alice-bob.ts#L95
    # remote – The remote Agent. src/alice-bob.ts#L99
    # agents(local, remote) – Returns the agents tuple [alice, bob]. src/alice-bob.ts#L276

      Example:

      const [alice, bob] = new Alice<Local, Remote>().agents()
      
      // to enable debugging on local (alice)
      const [alice, bob] = new Alice<Local, Remote>().agents({ debug: true })
      
      // use different names:
      const [alice, bob] = new Alice<Local, Remote>().agents(
        { name: 'server', debug: true },
        { name: 'client' }
      )
      

      # local
      # remote

      agents(local, remote)  =>

    # deserializer(data) src/alice-bob.ts#L108

      # data

        any

      deserializer(data)  =>

        any

    # serializer(data) src/alice-bob.ts#L107

      # data

        any

      serializer(data)  =>

        any

# AliceBob – AliceBob class. src/alice-bob.ts#L82
# Bob – Bob class. src/alice-bob.ts#L313
# Payload – Payload. src/alice-bob.ts#L6
# Agent – Agent. src/alice-bob.ts#L28
# PayloadMethod src/alice-bob.ts#L21

    # (payload)

      # payload

      (payload)  =>

        Promise<unknown> | unknown

Contributing

Fork or edit and submit a PR.

All contributions are welcome!

License

MIT © 2022 stagas

Keywords

ipc

FAQs

Package last updated on 30 Jul 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

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.