2.2.0 • Published 3 years ago

arpeecee v2.2.0

Weekly downloads
200
License
MIT
Repository
github
Last release
3 years ago

arpeecee

Simple duplex stream based binary RPC module for well defined services and methods

npm install arpeecee

Usage

const RPC = require('arpeecee')

const stream = new RPC({
  errorEncoding: someAbstractEncoding
})

// define a method
const aMethod = stream.defineService({ id: 1 })
  .defineMethod({
    id: 1,
    requestEncoding: someAbstractEncoding,
    responseEncoding: someAbstractEncoding,
    async onrequest (value) {
      console.log('decoded request', value)
      // return decoded response
    }
  })

// call the method on the other side
const decodedResponse = await aMethod.request(decodedValue)

stream.pipe(someStream).pipe(stream)

LICENSE

MIT

2.2.0

3 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.0

4 years ago