Welcome to the Linux Foundation Forum!

Lesson 12 Stream Types

In lesson 12 in the Stream Types lesson there is a Stream function. It references EE, does anyone know what is that?
And the function is not used anywhere in the code typed into the CLI nor the descriptions.

function Stream(opts) {
  EE.call(this, opts);
}

Is it something that is not supposed to be there? Thanks for any help in advance.

Comments

  • Hey @seetdev thanks for reporting this, I'm not seeing it in my original source material. Is this in code files or in the material?

  • belezyc
    belezyc Posts: 1
    edited January 2023

    Hi, interesting question, did not notice.
    @davidmarkclements it's when you write: > node -p "stream + ''" in the prompt
    Thanks in advance for your answer.

    KR,
    Clément

  • xdxmxc
    xdxmxc Posts: 157

    ohhhh

    yeah that's showing you node internals

    the stream module is actually a constructor function that "subclasses" (remember, not really a real thing in JS, JS class broadly functionally the same as JS constructor) EE - which will be the reference uses in Node internals for the EventEmitter

    It's just a way to show, demonstrably, that streams inherit from event emitter

Categories

Upcoming Training