file-type 17.0.2 → 17.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser.d.ts +6 -2
- package/core.d.ts +6 -3
- package/core.js +16 -13
- package/package.json +4 -2
- package/readme.md +150 -128
- package/supported.js +2 -0
package/browser.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {FileTypeResult} from './core.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
|
|
4
|
+
Detect the file type of a [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream).
|
|
5
5
|
|
|
6
|
+
@example
|
|
6
7
|
```
|
|
7
8
|
import {fileTypeFromStream} from 'file-type';
|
|
8
9
|
|
|
@@ -18,8 +19,11 @@ console.log(fileType);
|
|
|
18
19
|
export declare function fileTypeFromStream(stream: ReadableStream): Promise<FileTypeResult | undefined>;
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
|
-
|
|
22
|
+
Detect the file type of a [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob).
|
|
22
23
|
|
|
24
|
+
__Note:__ This method is only available in the browser.
|
|
25
|
+
|
|
26
|
+
@example
|
|
23
27
|
```
|
|
24
28
|
import {fileTypeFromBlob} from 'file-type';
|
|
25
29
|
|
package/core.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export type FileExtension =
|
|
|
49
49
|
| 'pdf'
|
|
50
50
|
| 'epub'
|
|
51
51
|
| 'mobi'
|
|
52
|
+
| 'elf'
|
|
52
53
|
| 'exe'
|
|
53
54
|
| 'swf'
|
|
54
55
|
| 'rtf'
|
|
@@ -195,6 +196,7 @@ export type MimeType =
|
|
|
195
196
|
| 'audio/wavpack'
|
|
196
197
|
| 'audio/amr'
|
|
197
198
|
| 'application/pdf'
|
|
199
|
+
| 'application/x-elf'
|
|
198
200
|
| 'application/x-msdownload'
|
|
199
201
|
| 'application/x-shockwave-flash'
|
|
200
202
|
| 'application/rtf'
|
|
@@ -321,8 +323,12 @@ This method is used internally, but can also be used for a special "tokenizer" r
|
|
|
321
323
|
|
|
322
324
|
A tokenizer propagates the internal read functions, allowing alternative transport mechanisms, to access files, to be implemented and used.
|
|
323
325
|
|
|
326
|
+
@param tokenizer - File source implementing the tokenizer interface.
|
|
327
|
+
@returns The detected file type and MIME type, or `undefined` when there is no match.
|
|
328
|
+
|
|
324
329
|
An example is [`@tokenizer/http`](https://github.com/Borewit/tokenizer-http), which requests data using [HTTP-range-requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests). A difference with a conventional stream and the [*tokenizer*](https://github.com/Borewit/strtok3#tokenizer), is that it is able to *ignore* (seek, fast-forward) in the stream. For example, you may only need and read the first 6 bytes, and the last 128 bytes, which may be an advantage in case reading the entire file would take longer.
|
|
325
330
|
|
|
331
|
+
@example
|
|
326
332
|
```
|
|
327
333
|
import {makeTokenizer} from '@tokenizer/http';
|
|
328
334
|
import {fileTypeFromTokenizer} from 'file-type';
|
|
@@ -335,9 +341,6 @@ const fileType = await fileTypeFromTokenizer(httpTokenizer);
|
|
|
335
341
|
console.log(fileType);
|
|
336
342
|
//=> {ext: 'mp3', mime: 'audio/mpeg'}
|
|
337
343
|
```
|
|
338
|
-
|
|
339
|
-
@param tokenizer - File source implementing the tokenizer interface.
|
|
340
|
-
@returns The detected file type and MIME type, or `undefined` when there is no match.
|
|
341
344
|
*/
|
|
342
345
|
export function fileTypeFromTokenizer(tokenizer: ITokenizer): Promise<FileTypeResult | undefined>;
|
|
343
346
|
|
package/core.js
CHANGED
|
@@ -81,11 +81,6 @@ class FileTypeParser {
|
|
|
81
81
|
tokenizer.fileInfo.size = Number.MAX_SAFE_INTEGER;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
// Keep reading until EOF if the file size is unknown.
|
|
85
|
-
if (tokenizer.fileInfo.size === undefined) {
|
|
86
|
-
tokenizer.fileInfo.size = Number.MAX_SAFE_INTEGER;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
84
|
this.tokenizer = tokenizer;
|
|
90
85
|
|
|
91
86
|
await tokenizer.peekBuffer(this.buffer, {length: 12, mayBeLess: true});
|
|
@@ -151,6 +146,13 @@ class FileTypeParser {
|
|
|
151
146
|
|
|
152
147
|
// -- 3-byte signatures --
|
|
153
148
|
|
|
149
|
+
if (this.check([0x47, 0x49, 0x46])) {
|
|
150
|
+
return {
|
|
151
|
+
ext: 'gif',
|
|
152
|
+
mime: 'image/gif',
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
154
156
|
if (this.check([0xFF, 0xD8, 0xFF])) {
|
|
155
157
|
return {
|
|
156
158
|
ext: 'jpg',
|
|
@@ -214,13 +216,6 @@ class FileTypeParser {
|
|
|
214
216
|
|
|
215
217
|
// -- 4-byte signatures --
|
|
216
218
|
|
|
217
|
-
if (this.check([0x47, 0x49, 0x46])) {
|
|
218
|
-
return {
|
|
219
|
-
ext: 'gif',
|
|
220
|
-
mime: 'image/gif',
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
|
|
224
219
|
if (this.checkString('FLIF')) {
|
|
225
220
|
return {
|
|
226
221
|
ext: 'flif',
|
|
@@ -336,7 +331,7 @@ class FileTypeParser {
|
|
|
336
331
|
// - one entry indicating specific type of file.
|
|
337
332
|
// MS Office, OpenOffice and LibreOffice may put the parts in different order, so the check should not rely on it.
|
|
338
333
|
if (zipHeader.filename === 'mimetype' && zipHeader.compressedSize === zipHeader.uncompressedSize) {
|
|
339
|
-
const mimeType = await tokenizer.readToken(new Token.StringType(zipHeader.compressedSize, 'utf-8'));
|
|
334
|
+
const mimeType = (await tokenizer.readToken(new Token.StringType(zipHeader.compressedSize, 'utf-8'))).trim();
|
|
340
335
|
|
|
341
336
|
switch (mimeType) {
|
|
342
337
|
case 'application/epub+zip':
|
|
@@ -477,6 +472,7 @@ class FileTypeParser {
|
|
|
477
472
|
const brandMajor = this.buffer.toString('binary', 8, 12).replace('\0', ' ').trim();
|
|
478
473
|
switch (brandMajor) {
|
|
479
474
|
case 'avif':
|
|
475
|
+
case 'avis':
|
|
480
476
|
return {ext: 'avif', mime: 'image/avif'};
|
|
481
477
|
case 'mif1':
|
|
482
478
|
return {ext: 'heic', mime: 'image/heif'};
|
|
@@ -790,6 +786,13 @@ class FileTypeParser {
|
|
|
790
786
|
};
|
|
791
787
|
}
|
|
792
788
|
|
|
789
|
+
if (this.check([0x7F, 0x45, 0x4C, 0x46])) {
|
|
790
|
+
return {
|
|
791
|
+
ext: 'elf',
|
|
792
|
+
mime: 'application/x-elf',
|
|
793
|
+
};
|
|
794
|
+
}
|
|
795
|
+
|
|
793
796
|
// -- 5-byte signatures --
|
|
794
797
|
|
|
795
798
|
if (this.check([0x4F, 0x54, 0x54, 0x4F, 0x00])) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "file-type",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.1.2",
|
|
4
4
|
"description": "Detect the file type of a Buffer/Uint8Array/ArrayBuffer",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "sindresorhus/file-type",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"check",
|
|
52
52
|
"is",
|
|
53
53
|
"exif",
|
|
54
|
+
"elf",
|
|
54
55
|
"exe",
|
|
55
56
|
"binary",
|
|
56
57
|
"buffer",
|
|
@@ -197,12 +198,13 @@
|
|
|
197
198
|
"dependencies": {
|
|
198
199
|
"readable-web-to-node-stream": "^3.0.2",
|
|
199
200
|
"strtok3": "^7.0.0-alpha.7",
|
|
200
|
-
"token-types": "^5.0.0-alpha.
|
|
201
|
+
"token-types": "^5.0.0-alpha.2"
|
|
201
202
|
},
|
|
202
203
|
"devDependencies": {
|
|
203
204
|
"@tokenizer/token": "^0.3.0",
|
|
204
205
|
"@types/node": "^16.11.10",
|
|
205
206
|
"ava": "^3.15.0",
|
|
207
|
+
"commonmark": "^0.30.0",
|
|
206
208
|
"noop-stream": "^1.0.0",
|
|
207
209
|
"tsd": "^0.19.0",
|
|
208
210
|
"typescript": "^4.5.2",
|
package/readme.md
CHANGED
|
@@ -6,6 +6,8 @@ The file type is detected by checking the [magic number](https://en.wikipedia.or
|
|
|
6
6
|
|
|
7
7
|
This package is for detecting binary-based file formats, not text-based formats like `.txt`, `.csv`, `.svg`, etc.
|
|
8
8
|
|
|
9
|
+
We accept contributions for commonly used modern file formats, not historical or obscure ones. Open an issue first for discussion.
|
|
10
|
+
|
|
9
11
|
<br>
|
|
10
12
|
|
|
11
13
|
---
|
|
@@ -42,6 +44,10 @@ This package is for detecting binary-based file formats, not text-based formats
|
|
|
42
44
|
npm install file-type
|
|
43
45
|
```
|
|
44
46
|
|
|
47
|
+
**This package is a ESM package. Your project needs to be ESM too. [Read more](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).**
|
|
48
|
+
|
|
49
|
+
If you use it with Webpack, you need the latest Webpack version and ensure you configure it correctly for ESM.
|
|
50
|
+
|
|
45
51
|
## Usage
|
|
46
52
|
|
|
47
53
|
#### Node.js
|
|
@@ -127,18 +133,6 @@ console.log(fileType);
|
|
|
127
133
|
//=> {ext: 'jpg', mime: 'image/jpeg'}
|
|
128
134
|
```
|
|
129
135
|
|
|
130
|
-
```js
|
|
131
|
-
import {fileTypeFromBlob} from 'file-type';
|
|
132
|
-
|
|
133
|
-
const blob = new Blob(['<?xml version="1.0" encoding="ISO-8859-1" ?>'], {
|
|
134
|
-
type: 'plain/text',
|
|
135
|
-
endings: 'native'
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
console.log(await fileTypeFromBlob(blob));
|
|
139
|
-
//=> {ext: 'txt', mime: 'plain/text'}
|
|
140
|
-
```
|
|
141
|
-
|
|
142
136
|
## API
|
|
143
137
|
|
|
144
138
|
### fileTypeFromBuffer(buffer)
|
|
@@ -200,6 +194,33 @@ Type: [`stream.Readable`](https://nodejs.org/api/stream.html#stream_class_stream
|
|
|
200
194
|
|
|
201
195
|
A readable stream representing file data.
|
|
202
196
|
|
|
197
|
+
### fileTypeFromBlob(blob)
|
|
198
|
+
|
|
199
|
+
Detect the file type of a [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob).
|
|
200
|
+
|
|
201
|
+
**Note:** This method is only available in the browser.
|
|
202
|
+
|
|
203
|
+
The file type is detected by checking the [magic number](https://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files) of the buffer.
|
|
204
|
+
|
|
205
|
+
Returns a `Promise` for an object with the detected file type and MIME type:
|
|
206
|
+
|
|
207
|
+
- `ext` - One of the [supported file types](#supported-file-types)
|
|
208
|
+
- `mime` - The [MIME type](https://en.wikipedia.org/wiki/Internet_media_type)
|
|
209
|
+
|
|
210
|
+
Or `undefined` when there is no match.
|
|
211
|
+
|
|
212
|
+
```js
|
|
213
|
+
import {fileTypeFromBlob} from 'file-type';
|
|
214
|
+
|
|
215
|
+
const blob = new Blob(['<?xml version="1.0" encoding="ISO-8859-1" ?>'], {
|
|
216
|
+
type: 'plain/text',
|
|
217
|
+
endings: 'native'
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
console.log(await fileTypeFromBlob(blob));
|
|
221
|
+
//=> {ext: 'txt', mime: 'plain/text'}
|
|
222
|
+
```
|
|
223
|
+
|
|
203
224
|
### fileTypeFromTokenizer(tokenizer)
|
|
204
225
|
|
|
205
226
|
Detect the file type from an `ITokenizer` source.
|
|
@@ -318,144 +339,145 @@ Returns a `Set<string>` of supported MIME types.
|
|
|
318
339
|
|
|
319
340
|
## Supported file types
|
|
320
341
|
|
|
321
|
-
- [`
|
|
322
|
-
- [`
|
|
342
|
+
- [`3g2`](https://en.wikipedia.org/wiki/3GP_and_3G2#3G2) - Multimedia container format defined by the 3GPP2 for 3G CDMA2000 multimedia services
|
|
343
|
+
- [`3gp`](https://en.wikipedia.org/wiki/3GP_and_3G2#3GP) - Multimedia container format defined by the Third Generation Partnership Project (3GPP) for 3G UMTS multimedia services
|
|
344
|
+
- [`3mf`](https://en.wikipedia.org/wiki/3D_Manufacturing_Format) - 3D Manufacturing Format
|
|
345
|
+
- [`7z`](https://en.wikipedia.org/wiki/7z) - 7-Zip archive
|
|
346
|
+
- [`Z`](https://fileinfo.com/extension/z) - Unix Compressed File
|
|
347
|
+
- [`aac`](https://en.wikipedia.org/wiki/Advanced_Audio_Coding) - Advanced Audio Coding
|
|
348
|
+
- [`ac3`](https://www.atsc.org/standard/a522012-digital-audio-compression-ac-3-e-ac-3-standard-12172012/) - ATSC A/52 Audio File
|
|
349
|
+
- [`ai`](https://en.wikipedia.org/wiki/Adobe_Illustrator_Artwork) - Adobe Illustrator Artwork
|
|
350
|
+
- [`aif`](https://en.wikipedia.org/wiki/Audio_Interchange_File_Format) - Audio Interchange file
|
|
351
|
+
- [`alias`](https://en.wikipedia.org/wiki/Alias_%28Mac_OS%29) - macOS Alias file
|
|
352
|
+
- [`amr`](https://en.wikipedia.org/wiki/Adaptive_Multi-Rate_audio_codec) - Adaptive Multi-Rate audio codec
|
|
353
|
+
- [`ape`](https://en.wikipedia.org/wiki/Monkey%27s_Audio) - Monkey's Audio
|
|
323
354
|
- [`apng`](https://en.wikipedia.org/wiki/APNG) - Animated Portable Network Graphics
|
|
324
|
-
- [`
|
|
325
|
-
- [`
|
|
326
|
-
- [`
|
|
327
|
-
- [`
|
|
355
|
+
- [`ar`](https://en.wikipedia.org/wiki/Ar_(Unix)) - Archive file
|
|
356
|
+
- [`arrow`](https://arrow.apache.org) - Columnar format for tables of data
|
|
357
|
+
- [`arw`](https://en.wikipedia.org/wiki/Raw_image_format#ARW) - Sony Alpha Raw image file
|
|
358
|
+
- [`asar`](https://github.com/electron/asar#format) - Archive format primarily used to enclose Electron applications
|
|
359
|
+
- [`asf`](https://en.wikipedia.org/wiki/Advanced_Systems_Format) - Advanced Systems Format
|
|
360
|
+
- [`avi`](https://en.wikipedia.org/wiki/Audio_Video_Interleave) - Audio Video Interleave file
|
|
361
|
+
- [`avif`](https://en.wikipedia.org/wiki/AV1#AV1_Image_File_Format_(AVIF)) - AV1 Image File Format
|
|
362
|
+
- [`blend`](https://wiki.blender.org/index.php/Dev:Source/Architecture/File_Format) - Blender project
|
|
363
|
+
- [`bmp`](https://en.wikipedia.org/wiki/BMP_file_format) - Bitmap image file
|
|
364
|
+
- [`bpg`](https://bellard.org/bpg/) - Better Portable Graphics file
|
|
365
|
+
- [`bz2`](https://en.wikipedia.org/wiki/Bzip2) - Archive file
|
|
366
|
+
- [`cab`](https://en.wikipedia.org/wiki/Cabinet_(file_format)) - Cabinet file
|
|
367
|
+
- [`cfb`](https://en.wikipedia.org/wiki/Compound_File_Binary_Format) - Compount File Binary Format
|
|
368
|
+
- [`chm`](https://en.wikipedia.org/wiki/Microsoft_Compiled_HTML_Help) - Microsoft Compiled HTML Help
|
|
328
369
|
- [`cr2`](https://fileinfo.com/extension/cr2) - Canon Raw image file (v2)
|
|
329
370
|
- [`cr3`](https://fileinfo.com/extension/cr3) - Canon Raw image file (v3)
|
|
330
|
-
- [`
|
|
331
|
-
- [`
|
|
371
|
+
- [`crx`](https://developer.chrome.com/extensions/crx) - Google Chrome extension
|
|
372
|
+
- [`cur`](https://en.wikipedia.org/wiki/ICO_(file_format)) - Icon file
|
|
373
|
+
- [`dcm`](https://en.wikipedia.org/wiki/DICOM#Data_format) - DICOM Image File
|
|
374
|
+
- [`deb`](https://en.wikipedia.org/wiki/Deb_(file_format)) - Debian package
|
|
375
|
+
- [`dmg`](https://en.wikipedia.org/wiki/Apple_Disk_Image) - Apple Disk Image
|
|
332
376
|
- [`dng`](https://en.wikipedia.org/wiki/Digital_Negative) - Adobe Digital Negative image file
|
|
333
|
-
- [`
|
|
334
|
-
- [`
|
|
335
|
-
- [`
|
|
336
|
-
- [`
|
|
337
|
-
- [`
|
|
377
|
+
- [`docx`](https://en.wikipedia.org/wiki/Office_Open_XML) - Microsoft Word
|
|
378
|
+
- [`dsf`](https://dsd-guide.com/sites/default/files/white-papers/DSFFileFormatSpec_E.pdf) - Sony DSD Stream File (DSF)
|
|
379
|
+
- [`elf`](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format) - Unix Executable and Linkable Format
|
|
380
|
+
- [`eot`](https://en.wikipedia.org/wiki/Embedded_OpenType) - Embedded OpenType font
|
|
381
|
+
- [`eps`](https://en.wikipedia.org/wiki/Encapsulated_PostScript) - Encapsulated PostScript
|
|
382
|
+
- [`epub`](https://en.wikipedia.org/wiki/EPUB) - E-book file
|
|
383
|
+
- [`exe`](https://en.wikipedia.org/wiki/.exe) - Executable file
|
|
384
|
+
- [`f4a`](https://en.wikipedia.org/wiki/Flash_Video) - Audio-only ISO base media file format used by Adobe Flash Player
|
|
385
|
+
- [`f4b`](https://en.wikipedia.org/wiki/Flash_Video) - Audiobook and podcast ISO base media file format used by Adobe Flash Player
|
|
386
|
+
- [`f4p`](https://en.wikipedia.org/wiki/Flash_Video) - ISO base media file format protected by Adobe Access DRM used by Adobe Flash Player
|
|
387
|
+
- [`f4v`](https://en.wikipedia.org/wiki/Flash_Video) - ISO base media file format used by Adobe Flash Player
|
|
388
|
+
- [`flac`](https://en.wikipedia.org/wiki/FLAC) - Free Lossless Audio Codec
|
|
389
|
+
- [`flif`](https://en.wikipedia.org/wiki/Free_Lossless_Image_Format) - Free Lossless Image Format
|
|
390
|
+
- [`flv`](https://en.wikipedia.org/wiki/Flash_Video) - Flash video
|
|
391
|
+
- [`gif`](https://en.wikipedia.org/wiki/GIF) - Graphics Interchange Format
|
|
392
|
+
- [`glb`](https://github.com/KhronosGroup/glTF) - GL Transmission Format
|
|
393
|
+
- [`gz`](https://en.wikipedia.org/wiki/Gzip) - Archive file
|
|
394
|
+
- [`heic`](https://nokiatech.github.io/heif/technical.html) - High Efficiency Image File Format
|
|
338
395
|
- [`icns`](https://en.wikipedia.org/wiki/Apple_Icon_Image_format) - Apple Icon image
|
|
339
|
-
- [`
|
|
340
|
-
- [`
|
|
396
|
+
- [`ico`](https://en.wikipedia.org/wiki/ICO_(file_format)) - Windows icon file
|
|
397
|
+
- [`ics`](https://en.wikipedia.org/wiki/ICalendar#Data_format) - iCalendar
|
|
341
398
|
- [`indd`](https://en.wikipedia.org/wiki/Adobe_InDesign#File_format) - Adobe InDesign document
|
|
342
|
-
- [`
|
|
343
|
-
- [`
|
|
344
|
-
- [`
|
|
345
|
-
- [`
|
|
346
|
-
- [`
|
|
347
|
-
- [`
|
|
348
|
-
- [`
|
|
349
|
-
- [`
|
|
350
|
-
- [`
|
|
399
|
+
- [`it`](https://wiki.openmpt.org/Manual:_Module_formats#The_Impulse_Tracker_format_.28.it.29) - Audio module format: Impulse Tracker
|
|
400
|
+
- [`jp2`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
|
|
401
|
+
- [`jpg`](https://en.wikipedia.org/wiki/JPEG) - Joint Photographic Experts Group image
|
|
402
|
+
- [`jpm`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
|
|
403
|
+
- [`jpx`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
|
|
404
|
+
- [`jxl`](https://en.wikipedia.org/wiki/JPEG_XL) - JPEG XL image format
|
|
405
|
+
- [`jxr`](https://en.wikipedia.org/wiki/JPEG_XR) - Joint Photographic Experts Group extended range
|
|
406
|
+
- [`ktx`](https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/) - OpenGL and OpenGL ES textures
|
|
407
|
+
- [`lnk`](https://en.wikipedia.org/wiki/Shortcut_%28computing%29#Microsoft_Windows) - Microsoft Windows file shortcut
|
|
408
|
+
- [`lz`](https://en.wikipedia.org/wiki/Lzip) - Arhive file
|
|
409
|
+
- [`lzh`](https://en.wikipedia.org/wiki/LHA_(file_format)) - LZH archive
|
|
410
|
+
- [`m4a`](https://en.wikipedia.org/wiki/M4A) - Audio-only MPEG-4 files
|
|
411
|
+
- [`m4b`](https://en.wikipedia.org/wiki/M4B) - Audiobook and podcast MPEG-4 files, which also contain metadata including chapter markers, images, and hyperlinks
|
|
412
|
+
- [`m4p`](https://en.wikipedia.org/wiki/MPEG-4_Part_14#Filename_extensions) - MPEG-4 files with audio streams encrypted by FairPlay Digital Rights Management as were sold through the iTunes Store
|
|
413
|
+
- [`m4v`](https://en.wikipedia.org/wiki/M4V) - MPEG-4 Visual bitstreams
|
|
351
414
|
- [`mid`](https://en.wikipedia.org/wiki/MIDI) - Musical Instrument Digital Interface file
|
|
415
|
+
- [`mie`](https://en.wikipedia.org/wiki/Sidecar_file) - Dedicated meta information format which supports storage of binary as well as textual meta information
|
|
416
|
+
- [`mj2`](https://en.wikipedia.org/wiki/Motion_JPEG_2000) - Motion JPEG 2000
|
|
352
417
|
- [`mkv`](https://en.wikipedia.org/wiki/Matroska) - Matroska video file
|
|
353
|
-
- [`
|
|
418
|
+
- [`mobi`](https://en.wikipedia.org/wiki/Mobipocket) - Mobipocket
|
|
354
419
|
- [`mov`](https://en.wikipedia.org/wiki/QuickTime_File_Format) - QuickTime video file
|
|
355
|
-
- [`avi`](https://en.wikipedia.org/wiki/Audio_Video_Interleave) - Audio Video Interleave file
|
|
356
|
-
- [`mpg`](https://en.wikipedia.org/wiki/MPEG-1) - MPEG-1 file
|
|
357
420
|
- [`mp1`](https://en.wikipedia.org/wiki/MPEG-1_Audio_Layer_I) - MPEG-1 Audio Layer I
|
|
358
421
|
- [`mp2`](https://en.wikipedia.org/wiki/MPEG-1_Audio_Layer_II) - MPEG-1 Audio Layer II
|
|
359
422
|
- [`mp3`](https://en.wikipedia.org/wiki/MP3) - Audio file
|
|
423
|
+
- [`mp4`](https://en.wikipedia.org/wiki/MPEG-4_Part_14#Filename_extensions) - MPEG-4 Part 14 video file
|
|
424
|
+
- [`mpc`](https://en.wikipedia.org/wiki/Musepack) - Musepack (SV7 & SV8)
|
|
425
|
+
- [`mpg`](https://en.wikipedia.org/wiki/MPEG-1) - MPEG-1 file
|
|
426
|
+
- [`mts`](https://en.wikipedia.org/wiki/.m2ts) - MPEG-2 Transport Stream, both raw and Blu-ray Disc Audio-Video (BDAV) versions
|
|
427
|
+
- [`mxf`](https://en.wikipedia.org/wiki/Material_Exchange_Format) - Material Exchange Format
|
|
428
|
+
- [`nef`](https://www.nikonusa.com/en/learn-and-explore/a/products-and-innovation/nikon-electronic-format-nef.html) - Nikon Electronic Format image file
|
|
429
|
+
- [`nes`](https://fileinfo.com/extension/nes) - Nintendo NES ROM
|
|
430
|
+
- [`odp`](https://en.wikipedia.org/wiki/OpenDocument) - OpenDocument for presentations
|
|
431
|
+
- [`ods`](https://en.wikipedia.org/wiki/OpenDocument) - OpenDocument for spreadsheets
|
|
432
|
+
- [`odt`](https://en.wikipedia.org/wiki/OpenDocument) - OpenDocument for word processing
|
|
433
|
+
- [`oga`](https://en.wikipedia.org/wiki/Ogg) - Audio file
|
|
360
434
|
- [`ogg`](https://en.wikipedia.org/wiki/Ogg) - Audio file
|
|
361
|
-
- [`ogv`](https://en.wikipedia.org/wiki/Ogg) - Audio file
|
|
362
435
|
- [`ogm`](https://en.wikipedia.org/wiki/Ogg) - Audio file
|
|
363
|
-
- [`
|
|
364
|
-
- [`spx`](https://en.wikipedia.org/wiki/Ogg) - Audio file
|
|
436
|
+
- [`ogv`](https://en.wikipedia.org/wiki/Ogg) - Audio file
|
|
365
437
|
- [`ogx`](https://en.wikipedia.org/wiki/Ogg) - Audio file
|
|
366
438
|
- [`opus`](https://en.wikipedia.org/wiki/Opus_(audio_format)) - Audio file
|
|
367
|
-
- [`
|
|
368
|
-
- [`wav`](https://en.wikipedia.org/wiki/WAV) - Waveform Audio file
|
|
369
|
-
- [`qcp`](https://en.wikipedia.org/wiki/QCP) - Tagged and chunked data
|
|
370
|
-
- [`amr`](https://en.wikipedia.org/wiki/Adaptive_Multi-Rate_audio_codec) - Adaptive Multi-Rate audio codec
|
|
371
|
-
- [`pdf`](https://en.wikipedia.org/wiki/Portable_Document_Format) - Portable Document Format
|
|
372
|
-
- [`epub`](https://en.wikipedia.org/wiki/EPUB) - E-book file
|
|
373
|
-
- [`mobi`](https://en.wikipedia.org/wiki/Mobipocket) - Mobipocket
|
|
374
|
-
- [`exe`](https://en.wikipedia.org/wiki/.exe) - Executable file
|
|
375
|
-
- [`swf`](https://en.wikipedia.org/wiki/SWF) - Adobe Flash Player file
|
|
376
|
-
- [`rtf`](https://en.wikipedia.org/wiki/Rich_Text_Format) - Rich Text Format
|
|
377
|
-
- [`woff`](https://en.wikipedia.org/wiki/Web_Open_Font_Format) - Web Open Font Format
|
|
378
|
-
- [`woff2`](https://en.wikipedia.org/wiki/Web_Open_Font_Format) - Web Open Font Format
|
|
379
|
-
- [`eot`](https://en.wikipedia.org/wiki/Embedded_OpenType) - Embedded OpenType font
|
|
380
|
-
- [`ttf`](https://en.wikipedia.org/wiki/TrueType) - TrueType font
|
|
439
|
+
- [`orf`](https://en.wikipedia.org/wiki/ORF_format) - Olympus Raw image file
|
|
381
440
|
- [`otf`](https://en.wikipedia.org/wiki/OpenType) - OpenType font
|
|
382
|
-
- [`
|
|
383
|
-
- [`
|
|
441
|
+
- [`pcap`](https://wiki.wireshark.org/Development/LibpcapFileFormat) - Libpcap File Format
|
|
442
|
+
- [`pdf`](https://en.wikipedia.org/wiki/Portable_Document_Format) - Portable Document Format
|
|
443
|
+
- [`pgp`](https://en.wikipedia.org/wiki/Pretty_Good_Privacy) - Pretty Good Privacy
|
|
444
|
+
- [`png`](https://en.wikipedia.org/wiki/Portable_Network_Graphics) - Portable Network Graphics
|
|
445
|
+
- [`pptx`](https://en.wikipedia.org/wiki/Office_Open_XML) - Microsoft Powerpoint
|
|
384
446
|
- [`ps`](https://en.wikipedia.org/wiki/Postscript) - Postscript
|
|
385
|
-
- [`
|
|
386
|
-
- [`
|
|
387
|
-
- [`
|
|
388
|
-
- [`
|
|
389
|
-
- [`xpi`](https://en.wikipedia.org/wiki/XPInstall) - XPInstall file
|
|
390
|
-
- [`cab`](https://en.wikipedia.org/wiki/Cabinet_(file_format)) - Cabinet file
|
|
391
|
-
- [`deb`](https://en.wikipedia.org/wiki/Deb_(file_format)) - Debian package
|
|
392
|
-
- [`ar`](https://en.wikipedia.org/wiki/Ar_(Unix)) - Archive file
|
|
447
|
+
- [`psd`](https://en.wikipedia.org/wiki/Adobe_Photoshop#File_format) - Adobe Photoshop document
|
|
448
|
+
- [`qcp`](https://en.wikipedia.org/wiki/QCP) - Tagged and chunked data
|
|
449
|
+
- [`raf`](https://en.wikipedia.org/wiki/Raw_image_format) - Fujifilm RAW image file
|
|
450
|
+
- [`rar`](https://en.wikipedia.org/wiki/RAR_(file_format)) - Archive file
|
|
393
451
|
- [`rpm`](https://fileinfo.com/extension/rpm) - Red Hat Package Manager file
|
|
394
|
-
- [`
|
|
395
|
-
- [`
|
|
396
|
-
- [`cfb`](https://en.wikipedia.org/wiki/Compound_File_Binary_Format) - Compount File Binary Format
|
|
397
|
-
- [`mxf`](https://en.wikipedia.org/wiki/Material_Exchange_Format) - Material Exchange Format
|
|
398
|
-
- [`mts`](https://en.wikipedia.org/wiki/.m2ts) - MPEG-2 Transport Stream, both raw and Blu-ray Disc Audio-Video (BDAV) versions
|
|
399
|
-
- [`wasm`](https://en.wikipedia.org/wiki/WebAssembly) - WebAssembly intermediate compiled format
|
|
400
|
-
- [`blend`](https://wiki.blender.org/index.php/Dev:Source/Architecture/File_Format) - Blender project
|
|
401
|
-
- [`bpg`](https://bellard.org/bpg/) - Better Portable Graphics file
|
|
402
|
-
- [`docx`](https://en.wikipedia.org/wiki/Office_Open_XML) - Microsoft Word
|
|
403
|
-
- [`pptx`](https://en.wikipedia.org/wiki/Office_Open_XML) - Microsoft Powerpoint
|
|
404
|
-
- [`xlsx`](https://en.wikipedia.org/wiki/Office_Open_XML) - Microsoft Excel
|
|
405
|
-
- [`jp2`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
|
|
406
|
-
- [`jpm`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
|
|
407
|
-
- [`jpx`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
|
|
408
|
-
- [`mj2`](https://en.wikipedia.org/wiki/Motion_JPEG_2000) - Motion JPEG 2000
|
|
409
|
-
- [`aif`](https://en.wikipedia.org/wiki/Audio_Interchange_File_Format) - Audio Interchange file
|
|
410
|
-
- [`odt`](https://en.wikipedia.org/wiki/OpenDocument) - OpenDocument for word processing
|
|
411
|
-
- [`ods`](https://en.wikipedia.org/wiki/OpenDocument) - OpenDocument for spreadsheets
|
|
412
|
-
- [`odp`](https://en.wikipedia.org/wiki/OpenDocument) - OpenDocument for presentations
|
|
413
|
-
- [`xml`](https://en.wikipedia.org/wiki/XML) - eXtensible Markup Language
|
|
414
|
-
- [`heic`](https://nokiatech.github.io/heif/technical.html) - High Efficiency Image File Format
|
|
415
|
-
- [`cur`](https://en.wikipedia.org/wiki/ICO_(file_format)) - Icon file
|
|
416
|
-
- [`ktx`](https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/) - OpenGL and OpenGL ES textures
|
|
417
|
-
- [`ape`](https://en.wikipedia.org/wiki/Monkey%27s_Audio) - Monkey's Audio
|
|
418
|
-
- [`wv`](https://en.wikipedia.org/wiki/WavPack) - WavPack
|
|
419
|
-
- [`asf`](https://en.wikipedia.org/wiki/Advanced_Systems_Format) - Advanced Systems Format
|
|
420
|
-
- [`dcm`](https://en.wikipedia.org/wiki/DICOM#Data_format) - DICOM Image File
|
|
421
|
-
- [`mpc`](https://en.wikipedia.org/wiki/Musepack) - Musepack (SV7 & SV8)
|
|
422
|
-
- [`ics`](https://en.wikipedia.org/wiki/ICalendar#Data_format) - iCalendar
|
|
423
|
-
- [`vcf`](https://en.wikipedia.org/wiki/VCard) - vCard
|
|
424
|
-
- [`glb`](https://github.com/KhronosGroup/glTF) - GL Transmission Format
|
|
425
|
-
- [`pcap`](https://wiki.wireshark.org/Development/LibpcapFileFormat) - Libpcap File Format
|
|
426
|
-
- [`dsf`](https://dsd-guide.com/sites/default/files/white-papers/DSFFileFormatSpec_E.pdf) - Sony DSD Stream File (DSF)
|
|
427
|
-
- [`lnk`](https://en.wikipedia.org/wiki/Shortcut_%28computing%29#Microsoft_Windows) - Microsoft Windows file shortcut
|
|
428
|
-
- [`alias`](https://en.wikipedia.org/wiki/Alias_%28Mac_OS%29) - macOS Alias file
|
|
429
|
-
- [`voc`](https://wiki.multimedia.cx/index.php/Creative_Voice) - Creative Voice File
|
|
430
|
-
- [`ac3`](https://www.atsc.org/standard/a522012-digital-audio-compression-ac-3-e-ac-3-standard-12172012/) - ATSC A/52 Audio File
|
|
431
|
-
- [`3gp`](https://en.wikipedia.org/wiki/3GP_and_3G2#3GP) - Multimedia container format defined by the Third Generation Partnership Project (3GPP) for 3G UMTS multimedia services
|
|
432
|
-
- [`3g2`](https://en.wikipedia.org/wiki/3GP_and_3G2#3G2) - Multimedia container format defined by the 3GPP2 for 3G CDMA2000 multimedia services
|
|
433
|
-
- [`m4v`](https://en.wikipedia.org/wiki/M4V) - MPEG-4 Visual bitstreams
|
|
434
|
-
- [`m4p`](https://en.wikipedia.org/wiki/MPEG-4_Part_14#Filename_extensions) - MPEG-4 files with audio streams encrypted by FairPlay Digital Rights Management as were sold through the iTunes Store
|
|
435
|
-
- [`m4a`](https://en.wikipedia.org/wiki/M4A) - Audio-only MPEG-4 files
|
|
436
|
-
- [`m4b`](https://en.wikipedia.org/wiki/M4B) - Audiobook and podcast MPEG-4 files, which also contain metadata including chapter markers, images, and hyperlinks
|
|
437
|
-
- [`f4v`](https://en.wikipedia.org/wiki/Flash_Video) - ISO base media file format used by Adobe Flash Player
|
|
438
|
-
- [`f4p`](https://en.wikipedia.org/wiki/Flash_Video) - ISO base media file format protected by Adobe Access DRM used by Adobe Flash Player
|
|
439
|
-
- [`f4a`](https://en.wikipedia.org/wiki/Flash_Video) - Audio-only ISO base media file format used by Adobe Flash Player
|
|
440
|
-
- [`f4b`](https://en.wikipedia.org/wiki/Flash_Video) - Audiobook and podcast ISO base media file format used by Adobe Flash Player
|
|
441
|
-
- [`mie`](https://en.wikipedia.org/wiki/Sidecar_file) - Dedicated meta information format which supports storage of binary as well as textual meta information
|
|
442
|
-
- [`shp`](https://en.wikipedia.org/wiki/Shapefile) - Geospatial vector data format
|
|
443
|
-
- [`arrow`](https://arrow.apache.org) - Columnar format for tables of data
|
|
444
|
-
- [`aac`](https://en.wikipedia.org/wiki/Advanced_Audio_Coding) - Advanced Audio Coding
|
|
445
|
-
- [`it`](https://wiki.openmpt.org/Manual:_Module_formats#The_Impulse_Tracker_format_.28.it.29) - Audio module format: Impulse Tracker
|
|
452
|
+
- [`rtf`](https://en.wikipedia.org/wiki/Rich_Text_Format) - Rich Text Format
|
|
453
|
+
- [`rw2`](https://en.wikipedia.org/wiki/Raw_image_format) - Panasonic RAW image file
|
|
446
454
|
- [`s3m`](https://wiki.openmpt.org/Manual:_Module_formats#The_ScreamTracker_3_format_.28.s3m.29) - Audio module format: ScreamTracker 3
|
|
447
|
-
- [`
|
|
448
|
-
- [`ai`](https://en.wikipedia.org/wiki/Adobe_Illustrator_Artwork) - Adobe Illustrator Artwork
|
|
455
|
+
- [`shp`](https://en.wikipedia.org/wiki/Shapefile) - Geospatial vector data format
|
|
449
456
|
- [`skp`](https://en.wikipedia.org/wiki/SketchUp) - SketchUp
|
|
450
|
-
- [`
|
|
451
|
-
- [`
|
|
452
|
-
- [`lzh`](https://en.wikipedia.org/wiki/LHA_(file_format)) - LZH archive
|
|
453
|
-
- [`pgp`](https://en.wikipedia.org/wiki/Pretty_Good_Privacy) - Pretty Good Privacy
|
|
454
|
-
- [`asar`](https://github.com/electron/asar#format) - Archive format primarily used to enclose Electron applications
|
|
457
|
+
- [`spx`](https://en.wikipedia.org/wiki/Ogg) - Audio file
|
|
458
|
+
- [`sqlite`](https://www.sqlite.org/fileformat2.html) - SQLite file
|
|
455
459
|
- [`stl`](https://en.wikipedia.org/wiki/STL_(file_format)) - Standard Tesselated Geometry File Format (ASCII only)
|
|
456
|
-
- [`
|
|
457
|
-
- [`
|
|
458
|
-
- [`
|
|
460
|
+
- [`swf`](https://en.wikipedia.org/wiki/SWF) - Adobe Flash Player file
|
|
461
|
+
- [`tar`](https://en.wikipedia.org/wiki/Tar_(computing)#File_format) - Tarball archive file
|
|
462
|
+
- [`tif`](https://en.wikipedia.org/wiki/Tagged_Image_File_Format) - Tagged Image file
|
|
463
|
+
- [`ttf`](https://en.wikipedia.org/wiki/TrueType) - TrueType font
|
|
464
|
+
- [`vcf`](https://en.wikipedia.org/wiki/VCard) - vCard
|
|
465
|
+
- [`voc`](https://wiki.multimedia.cx/index.php/Creative_Voice) - Creative Voice File
|
|
466
|
+
- [`wasm`](https://en.wikipedia.org/wiki/WebAssembly) - WebAssembly intermediate compiled format
|
|
467
|
+
- [`wav`](https://en.wikipedia.org/wiki/WAV) - Waveform Audio file
|
|
468
|
+
- [`webm`](https://en.wikipedia.org/wiki/WebM) - Web video file
|
|
469
|
+
- [`webp`](https://en.wikipedia.org/wiki/WebP) - Web Picture format
|
|
470
|
+
- [`woff`](https://en.wikipedia.org/wiki/Web_Open_Font_Format) - Web Open Font Format
|
|
471
|
+
- [`woff2`](https://en.wikipedia.org/wiki/Web_Open_Font_Format) - Web Open Font Format
|
|
472
|
+
- [`wv`](https://en.wikipedia.org/wiki/WavPack) - WavPack
|
|
473
|
+
- [`xcf`](https://en.wikipedia.org/wiki/XCF_(file_format)) - eXperimental Computing Facility
|
|
474
|
+
- [`xlsx`](https://en.wikipedia.org/wiki/Office_Open_XML) - Microsoft Excel
|
|
475
|
+
- [`xm`](https://wiki.openmpt.org/Manual:_Module_formats#The_FastTracker_2_format_.28.xm.29) - Audio module format: FastTracker 2
|
|
476
|
+
- [`xml`](https://en.wikipedia.org/wiki/XML) - eXtensible Markup Language
|
|
477
|
+
- [`xpi`](https://en.wikipedia.org/wiki/XPInstall) - XPInstall file
|
|
478
|
+
- [`xz`](https://en.wikipedia.org/wiki/Xz) - Compressed file
|
|
479
|
+
- [`zip`](https://en.wikipedia.org/wiki/Zip_(file_format)) - Archive file
|
|
480
|
+
- [`zst`](https://en.wikipedia.org/wiki/Zstandard) - Archive file
|
|
459
481
|
|
|
460
482
|
*Pull requests are welcome for additional commonly used file types.*
|
|
461
483
|
|
package/supported.js
CHANGED
|
@@ -47,6 +47,7 @@ export const extensions = [
|
|
|
47
47
|
'amr',
|
|
48
48
|
'pdf',
|
|
49
49
|
'epub',
|
|
50
|
+
'elf',
|
|
50
51
|
'exe',
|
|
51
52
|
'swf',
|
|
52
53
|
'rtf',
|
|
@@ -193,6 +194,7 @@ export const mimeTypes = [
|
|
|
193
194
|
'audio/wavpack',
|
|
194
195
|
'audio/amr',
|
|
195
196
|
'application/pdf',
|
|
197
|
+
'application/x-elf',
|
|
196
198
|
'application/x-msdownload',
|
|
197
199
|
'application/x-shockwave-flash',
|
|
198
200
|
'application/rtf',
|