Skip to content

Docs missing for net.Socket .pipe() ? #1236

@Fl4m3Ph03n1x

Description

@Fl4m3Ph03n1x

I am reading the Net documentation for Node in order to create a socket server:

One of the first things I do is to try and understand the docs and code snippets. There is a special code snippet that caught my attention:

const server = net.createServer((c) => {
  // 'connection' listener
  console.log('client connected');
  c.on('end', () => {
    console.log('client disconnected');
  });
  c.write('hello\r\n');
  c.pipe(c);
});

c.on is for events, c.write is documented, but after searching the entire documentation page I can't find any entry for c.pipe.

If I get it right, c is a net.Socket object.

So, from that example I expect this method to be documented under:

https://nodejs.org/api/net.html#net_class_net_socket

But that is not the case.
Am I missing something or is the documentation incomplete?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions