npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nv-client-simple-stream

v1.0.14

Published

nv-client-simple-stream ======================= - nv-client-simple-stream

Downloads

28

Readme

nv-client-simple-stream

  • nv-client-simple-stream

install

  • npm install nv-client-simple-stream

usage

http

client

  const {Client} = require("nv-client-simple-stream").http;
  //new Client((url,query={},hash=''))

  server is a simple echo-server

init

        var c = new Client("http://127.0.0.1:8000/a/b/c")

        /*
        {
          hostname: '127.0.0.1',
          port: '8000',
          path: '/a/b/c/',
          method: 'POST',
          headers: {
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
            'Content-Type': 'application/octet-stream',
            'X-Body-Type': 'buffer'
          },
          keepalive: true
        }

        */

simple_send_with_file

    var r = await c.simple_send_with_file("./index.js")
    >r
    {
      err: null,
      headers: {
        'content-type': 'application/octet-stream',
        'x-body-type': 'buffer',
        date: 'Sat, 07 Aug 2021 09:05:53 GMT',
        connection: 'keep-alive',
        'keep-alive': 'timeout=4294',
        'transfer-encoding': 'chunked'
      },
      body: <Buffer 6d 6f 64 75 6c 65 2e 65 78 70 6f 72 74 73 20 3d 20 7b 0a 20 20 20 20 68 74 74 70 3a 20 7b 0a 20 20 20 20 20 20 20 20 63 6c 69 65 6e 74 3a 72 65 71 75 ... 281 more bytes>,
      local: { address: '127.0.0.1', family: 'IPv4', port: 33916 },
      peer: { address: '127.0.0.1', family: 'IPv4', port: 8000 }
    }

simple_send_with_read_stream

    var read$ = fs.createReadStream("./index.js")
    var r = await c.simple_send_with_read_stream(read$)
    > r
    {
      err: null,
      headers: {
        'content-type': 'application/octet-stream',
        'x-body-type': 'buffer',
        date: 'Sat, 07 Aug 2021 09:07:50 GMT',
        connection: 'keep-alive',
        'keep-alive': 'timeout=4294',
        'transfer-encoding': 'chunked'
      },
      body: <Buffer 6d 6f 64 75 6c 65 2e 65 78 70 6f 72 74 73 20 3d 20 7b 0a 20 20 20 20 68 74 74 70 3a 20 7b 0a 20 20 20 20 20 20 20 20 63 6c 69 65 6e 74 3a 72 65 71 75 ... 281 more bytes>,
      local: { address: '127.0.0.1', family: 'IPv4', port: 33916 },
      peer: { address: '127.0.0.1', family: 'IPv4', port: 8000 }
    }
    >

simple

    var r = await c.simple('ABCDE')
    > r
    {
      err: null,
      headers: {
        'content-type': 'application/octet-stream',
        'x-body-type': 'buffer',
        date: 'Sat, 07 Aug 2021 09:10:07 GMT',
        connection: 'keep-alive',
        'keep-alive': 'timeout=4294',
        'transfer-encoding': 'chunked'
      },
      body: <Buffer 41 42 43 44 45>,
      local: { address: '127.0.0.1', family: 'IPv4', port: 33916 },
      peer: { address: '127.0.0.1', family: 'IPv4', port: 8000 }
    }
    >

send_with_file_and_manual_recv

    function recv_chunk_handler(chunk,creq,cres) {
        console.log("received chunk: ",chunk.length)
    }

    var r = await c.send_with_file_and_manual_recv("./index.js",recv_chunk_handler)

    >
    received chunk:  331
    > r
    {
      err: null,
      headers: {
        'content-type': 'application/octet-stream',
        'x-body-type': 'buffer',
        date: 'Sat, 07 Aug 2021 09:32:23 GMT',
        connection: 'keep-alive',
        'keep-alive': 'timeout=4294',
        'transfer-encoding': 'chunked'
      },
      local: { address: '127.0.0.1', family: 'IPv4', port: 33918 },
      peer: { address: '127.0.0.1', family: 'IPv4', port: 8000 }
    }
    >

send_with_read_stream_and_manual_recv

    function recv_chunk_handler(chunk,creq,cres) {
        console.log("received chunk: ",chunk.length)
    }
    var read$ = fs.createReadStream("/mnt/sdb/NVNODE/node/out/Release/node")
    var r = await c.send_with_read_stream_and_manual_recv(read$,recv_chunk_handler)
    
    /*
    ....
    received chunk:  12
    received chunk:  60
    received chunk:  65450
    received chunk:  26
    received chunk:  60
    received chunk:  65464
    received chunk:  12
    received chunk:  60
    received chunk:  65450
    received chunk:  26
    received chunk:  60
    received chunk:  65464
    ....
    > r
    {
      err: null,
      headers: {
        'content-type': 'application/octet-stream',
        'x-body-type': 'buffer',
        date: 'Sat, 07 Aug 2021 09:36:46 GMT',
        connection: 'keep-alive',
        'keep-alive': 'timeout=4294',
        'transfer-encoding': 'chunked'
      },
      local: { address: '127.0.0.1', family: 'IPv4', port: 33918 },
      peer: { address: '127.0.0.1', family: 'IPv4', port: 8000 }
    }
    >
    
    
    Release# netstat -an | egrep tcp | egrep ESTABLISHED | egrep 8000
    tcp        0      0 127.0.0.1:33918         127.0.0.1:8000          ESTABLISHED
    tcp6       0      0 127.0.0.1:8000          127.0.0.1:33918         ESTABLISHED
    Release#
    
    */

manual

        function recv_chunk_handler(chunk,creq,cres) {
            console.log("received chunk: ",chunk.length)
        }

        var {headp,bodyp,send,end} = c.manual(recv_chunk_handler)



        > headp
        Promise { <pending> }
        > bodyp
        Promise { <pending> }

        > send.toString()
        "async function send(chunk,encoding='utf8') {return(await _send(creq,chunk))}"
        >
        > end.toString()
        'async function end() {return(await _end(creq))}'
        >


        var r = await send('ABCD')

        > received chunk:  4              //body chunk handler triggered

        > headp
        Promise {
          {
            'content-type': 'application/octet-stream',
            'x-body-type': 'buffer',
            date: 'Sat, 07 Aug 2021 09:54:30 GMT',
            connection: 'keep-alive',
            'keep-alive': 'timeout=4294',
            'transfer-encoding': 'chunked'
          }
        }
        >
        > var r = await send('ABCD')
        > received chunk:  4

        > var r = await send('XTz')
        > received chunk:  3

        > bodyp
        Promise { <pending> }
        >

        > var r = await end()
        > r
        true
        > bodyp
        Promise {
          {
            err: null,
            headers: {
              'content-type': 'application/octet-stream',
              'x-body-type': 'buffer',
              date: 'Sat, 07 Aug 2021 09:55:22 GMT',
              connection: 'keep-alive',
              'keep-alive': 'timeout=4294',
              'transfer-encoding': 'chunked'
            },
            local: { address: '127.0.0.1', family: 'IPv4', port: 33924 },
            peer: { address: '127.0.0.1', family: 'IPv4', port: 8000 }
          }
        }
        >

https

  • todo

http2

  • todo

METHODS

http

    c.options_
    c.url_
    c.method_
    c.disable_keepalive   c.enable_keepalive   c.keepalive_
    c.headers_
    c.body_type_


    c.simple(str_or_buffer,encode='utf8',keepalive=true,with_rqrs=false)
    c.simple_send_with_file(file_name,keepalive=true,with_rqrs=false)
    c.simple_send_with_read_stream(read_stream$,keepalive=true,with_rqrs=false)


    c.send_with_file_and_manual_recv(fn,recv_chunk_handler=(chunk,creq,cres)=>{},keepalive,with_rqrs=false)
    c.send_with_read_stream_and_manual_recv(read$,recv_chunk_handler=(chunk,creq,cres)=>{},keepalive,with_rqrs=false)

    c.send_with_sb_and_manual_recv(
        str_or_buffer,
        recv_chunk_handler=(chunk,creq,cres)=>{},
        encode='utf8',
        keepalive,
        with_rqrs=false
    )


    c.manual(recv_chunk_handler=(chunk,creq,cres)=>{},keepalive,with_rqrs=false)


    c.set_method_to_post
    c.set_method_to_get
    c.set_method_to_head
    c.set_method_to_connect
    c.set_method_to_delete
    c.set_method_to_options
    c.set_method_to_patch
    c.set_method_to_put
    c.set_method_to_trace

https

         const {Client} = require("nv-client-simple-stream").https;
         //new Client((url,query={},hash=''))

init

        var c = new Client("https://192.168.1.103:28443")
        var r = await c.simple('ABCDE')

http2

  • todo

API

http

 _simple_creq(that,keepalive=true,with_rqrs=false);
 _manual_creq(that,recv_chunk_handler,keepalive=true,with_rqrs=false);

https

 _simple_creq(that,keepalive=false,with_rqrs=false);
 _manual_creq(that,recv_chunk_handler,keepalive=false,with_rqrs=false);
 one_time_get(u,query,hash)

http2

  • todo

LICENSE

  • ISC