Node.js typings (ReadStream methods)
I want to talk about node/node.d.ts.
The method destroy of class fs.ReadStream is not available in the definition. I can call this method in regular javascript but not in typescript. Is it ok?
please send a pull request first. I'll review it.
@tarurar where exactly is this API documented? I can't find it on Node's site.
@DanielRosenwasser I don't see it either, but if you try to examine the __proto__ of the ReadStream object you will find this method:
ReadStream { open: [Function], _read: [Function], destroy: [Function], close: [Function] }
I saw examples in javascript which uses stream.destroy() to eliminate memory leaks.
@vvakame ok, done
@tarurar interestingly I just saw a PR relating to this pop up:
https://github.com/nodejs/node/issues/5898#issuecomment-212417054
In other words, it should probably be documented, but it should be fine to add here.
Hi. Just hit this. Wanted to make a PR for this, but wanted to understand the difference between the Readable class and the ReadableStream global interface.
The class is defining more methods than the interface, but a few packages I use (like dockerode) uses the global NodeJS.ReadableStream instead of the class. Seems like that may be common.
I believe the interface should define all these methods and the class should implement them, correct?
Hi thread, we're moving DefinitelyTyped to use GitHub Discussions for conversations the @types modules in DefinitelyTyped.
To help with the transition, we're closing all issues which haven't had activity in the last 6 months, which includes this issue. If you think closing this issue is a mistake, please pop into the TypeScript Community Discord and mention the issue in the definitely-typed channel.