Necromancers Playing MTG
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    ppqpublic

    ppq

    Push/Pull TCP Messaging. Somewhat inspired by punt.

    install

    $ npm install ppq

    usage

    Pull server

    var pull = require('ppq/pull')
    var server = pull(3000);
     
    server.on('message', function (msg) {
      console.log(msg);
    });

    Push client

    var push = require('ppq/push');
    var a = push('0.0.0.0:3000');
    var b = push('0.0.0.0:3000');
     
    setInterval(function () {
      a.send('kinkajou');
    }, 500);
     
    setInterval(function () {
      b.send('panda');
    }, 800);

    api

    pull(port)

    Returns a readable and writable stream listening on port.

    #close

    Closes the server listening on port.

    push(addr)

    Returns a readable and writable stream bound to addr.

    #send

    Sends an arbitrary message to bound addr.

    license

    MIT

    install

    npm i ppq

    Downloadsweekly downloads

    13

    version

    0.0.3

    license

    MIT

    repository

    githubgithub

    last publish

    collaborators

    • avatar
    • avatar