معرفی شرکت ها


stream-file-type-0.6.1


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

Get the [file type](https://github.com/sindresorhus/file-type) by inspecting a stream.
ویژگی مقدار
سیستم عامل -
نام فایل stream-file-type-0.6.1
نام stream-file-type
نسخه کتابخانه 0.6.1
نگهدارنده ['linusu']
ایمیل نگهدارنده ['linus@folkdatorn.se']
نویسنده -
ایمیل نویسنده -
آدرس صفحه اصلی git+https://github.com/LinusU/stream-file-type.git
آدرس اینترنتی https://github.com/LinusU/stream-file-type#readme
مجوز MIT
# Stream File Type Get the [file type](https://github.com/sindresorhus/file-type) by inspecting a stream. ## Usage ```js import fs from 'node:fs' import FileType from 'stream-file-type' const input = fs.createReadStream('cat.jpg') const detector = new FileType() // Listen for event... detector.on('file-type', (fileType) => { if (fileType === null) { console.log(`The mime type of "cat.jpg" could not be determined`) } else { console.log(`The file "cat.jpg" has the "${fileType.mime}" mime type`) } }) // ...or get a Promise detector.fileTypePromise().then((fileType) => { if (fileType === null) { console.log(`The mime type of "cat.jpg" could not be determined`) } else { console.log(`The file "cat.jpg" has the "${fileType.mime}" mime type`) } }) input.pipe(detector).resume() ``` ## API ### `new FileType() => DuplexStream` Returns a new `DuplexStream` that will detect the file type of the content passing thru. All the data is passed as-is right thru the stream, and can be further piped to another destination. When enough bytes have come thru to determine the file type (currently 4100) the event `file-type` will be emitted with the result of the detection. The result will either be `null` or an object with `ext` and `mime`. - `ext` - One of the [supported file types](https://github.com/sindresorhus/file-type#supported-file-types) - `mime` - The [MIME type](http://en.wikipedia.org/wiki/Internet_media_type) ### `FileType#fileTypePromise() => Promise` Returns a `Promise` of the detected file type. If the `file-type` event has already been emitted, the promise will be resolved with the result, otherwise the promise will be resolved when the file-type is detected.


نیازمندی

مقدار نام
^16.0.0 file-type


زبان مورد نیاز

مقدار نام
16.5.0 Npm


نحوه نصب


نصب پکیج tgz stream-file-type-0.6.1:

    npm install stream-file-type-0.6.1.tgz