Skip to content

Why isn't process.stdout an instanceof fs.WriteStream? #2973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tcodes0 opened this issue Sep 10, 2020 · 1 comment
Closed

Why isn't process.stdout an instanceof fs.WriteStream? #2973

tcodes0 opened this issue Sep 10, 2020 · 1 comment

Comments

@tcodes0
Copy link

tcodes0 commented Sep 10, 2020

  • Node.js Version: 14.9.0
  • OS: Linux Arch7 5.8.7-arch1-1 Update README for help #1 SMP PREEMPT Sat, 05 Sep 2020 12:31:32 +0000 x86_64 GNU/Linux
  • Scope (install, code, runtime, meta, other?): runtime
  • Module (and version) (if relevant): fs
> let s = require('fs').WriteStream
undefined
> s
[Function: WriteStream]
> process.stdout instanceof s
false
> process.stdout
<ref *1> WriteStream {
 ...
> process.stdout.constructor.name
'WriteStream'

this is confusing because process.stdout appears to be a WriteStream as far as I can tell.

@devsnek
Copy link
Member

devsnek commented Sep 10, 2020

It is a WriteStream, just not a fs WriteStream. Check out https://nodejs.org/api/tty.html#tty_class_tty_writestream.

@tcodes0 tcodes0 closed this as completed Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants