Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-61.54%
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)  =>

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

        # data

          any

        serializer(data)  =>

      # 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)

      Contributing

      Fork or edit and submit a PR.

      All contributions are welcome!

      License

      MIT © 2022 stagas

      Keywords

      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

      • 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