-
-
Notifications
You must be signed in to change notification settings - Fork 378
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
Improve Blob, file, and stream method documentation #641
Conversation
47fe441
to
2f738a8
Compare
readme.md
Outdated
@@ -147,7 +150,9 @@ The file path to parse. | |||
|
|||
### fileTypeFromStream(stream) | |||
|
|||
Detect the file type of a [Node.js readable stream](https://nodejs.org/api/stream.html#stream_class_stream_readable) or a [Web API ReadableStream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream). | |||
Detect the file type of a [Web API ReadableStream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Detect the file type of a [Web API ReadableStream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream). | |
Detect the file type of a [Web `ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream). |
You also need to update the doc comments in the types. |
Some of my suggested changes were not applied. It would have been better to simply commit the changes directly (they are diff suggestions, so you could have just pressed "commit suggestion"). |
There are still missed things, like #641 (comment) |
Mapped updated documentation to typings, and added some missing documentation Explained difference, and when to use `NodeFileTypeParser` instead of the `FileTypeParser` class
Co-authored-by: Sindre Sorhus <[email protected]>
Co-authored-by: Sindre Sorhus <[email protected]>
35bc2bc
to
7b4969b
Compare
Improve documentation of:
fileTypeFromFile(filePath)
: explain this method can only be used if the JavaScript engine is Node.jsfileTypeFromStream(stream)
explain that Node.js stream is only available when used with Node.jsfileTypeFromBlob(blob)
explain that this is the method to used for web API FileResolves #640