New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

pull-net

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pull-net

A replacement for net using pull streams all the way

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
12
50%
Maintainers
2
Weekly downloads
 
Created
Source

pull-net

pull-stream directly to node's libuv bindings.

echo server works, don't handle all the edge cases yet, or nice error messages etc.

example

var createServer = require('pull-net/server')

createServer(function (stream) {
  pull(stream.source, stream.sink) //ECHO
}).listen(9999, '127.0.0.1')

var connect = require('pull-net/client')

var stream = connect(9999, '127.0.0.1')

pull(
  pull.once(new Buffer('hello tcp')),
  stream,
  pull.collect(console.log)
)

Questions

node does some things that turn out to be unnecessary, like, take a callback for server.listen.

Maybe these cause problem when trying to use other stream types though, (such as like unix pipes, which are also handled in node/lib/net.js)

This is probably mainly to handle some errors... maybe those errors could just throw?

Also, there are often client type connections which may error before receiving data (at least in their context, such as authentication errors) often, this can't be a sync error. So that would suggest an api that was connect(function (err, stream) {...})

what if a server was a stream of clients? does that really help?

License

MIT

FAQs

Package last updated on 01 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts