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

seaport-stream

0.0.1 • Public • Published

seaport-stream build status

Create streams over seaport

Basically seaport but allows you to get streams and service streams rather then mess with the details of the IO protocol

Example Client

var seaport = require("seaport-stream")
 
var ports = seaport.connect("localhost", 9093)
 
var stream = ports.get("magic@1.2.x")
 
stream.on("data", function (data) {
    console.log("[CLIENT]", data.toString())
})
stream.write("hello from client!")

Example Server

var seaport = require("seaport-stream")
 
var ports = seaport.connect("localhost", 9093)
 
ports.service("magic@1.2.3", handleStream)
 
function handleStream(stream) {
    stream.write("hello from magic!")
    stream.on("data", function (data) {
        console.log("[MAGIC]", data.toString())
    })
}

Installation

npm install seaport-stream

Contributors

  • Raynos

MIT Licenced

Keywords

none

install

npm i seaport-stream

Downloadsweekly downloads

2

version

0.0.1

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar