Have ideas to improve npm?Join in the discussion! »

    stream-rpc

    0.1.1 • Public • Published

    stream-rpc

    RPC over arbitrary streams

    rpc = require 'stream-rpc'
    
    client = rpc(timeout: 1000)
    server = rpc
      handle: (request, done) ->
        done(null, request)
    
    client.pipe(server).pipe(client)
    

    or

    {json} = require 'stream-serializer'
    
    client
      .pipe(json)
      .pipe(serverConnectedSocket)
      .pipe(json)
      .pipe(client)
    
    server
      .pipe(json)
      .pipe(clientConnectedSocket)
      .pipe(json)
    

    Keywords

    none

    Install

    npm i stream-rpc

    DownloadsWeekly Downloads

    1

    Version

    0.1.1

    License

    MIT

    Last publish

    Collaborators

    • avatar