Skip to content

๐Ÿ‘œ A callbag source (client) for nodejs net.Socket

Notifications You must be signed in to change notification settings

av8ta/callbag-net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

21 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

callbag-net

Callbag listenable source that connects using nodejs net.Socket interface.

Read more about the Callbag standard here.

Example

// see: ./example/client.js
import { Client } from 'callbag-net'
import { createServer } from './server.mjs'
import { pipe, forEach } from 'callbag-basics-esmodules'

const source = Client({ port: 1234, host: 'localhost' })
createServer(1234, 'hello')

pipe(
  source,
  forEach(v /* Buffer */ => {
    console.log(v)
    console.log(v.toString())
  })
)
<Buffer 68 65 6c 6c 6f>
hello
Client(options: net.SocketConnectOpts, connectionListener?: (() => void))

About

๐Ÿ‘œ A callbag source (client) for nodejs net.Socket

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published