{"name":"file-type","version":"16.5.4","description":"Detect the file type of a Buffer/Uint8Array/ArrayBuffer","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/file-type.git"},"funding":"https://github.com/sindresorhus/file-type?sponsor=1","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=10"},"scripts":{"ava":"ava --serial --verbose","test":"xo && ava && tsd"},"keywords":["mime","file","type","magic","archive","image","img","pic","picture","flash","photo","video","detect","check","is","exif","exe","binary","buffer","uint8array","jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","ogg","opus","flac","wav","amr","pdf","epub","mobi","swf","rtf","woff","woff2","eot","ttf","otf","ico","flv","ps","xz","sqlite","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","wasm","webassembly","blend","bpg","docx","pptx","xlsx","3gp","jp2","jpm","jpx","mj2","aif","odt","ods","odp","xml","heic","ics","glb","pcap","dsf","lnk","alias","voc","ac3","3g2","m4b","m4p","m4v","f4a","f4b","f4p","f4v","mie","qcp","asf","ogv","ogm","oga","spx","ogx","ape","wv","cur","nes","crx","ktx","dcm","mpc","arrow","shp","aac","mp1","it","s3m","xm","ai","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf"],"devDependencies":{"@types/node":"^13.1.4","ava":"^2.3.0","noop-stream":"^0.1.0","read-chunk":"^3.2.0","tsd":"^0.11.0","xo":"^0.25.3"},"dependencies":{"readable-web-to-node-stream":"^3.0.0","strtok3":"^6.2.4","token-types":"^4.1.1"},"xo":{"envs":["node","browser"],"rules":{"no-inner-declarations":"warn","no-await-in-loop":"warn","promise/prefer-await-to-then":"warn","prefer-named-capture-group":"off"}},"types":"./index.d.ts","readme":"# file-type\n\n> Detect the file type of a Buffer/Uint8Array/ArrayBuffer\n\nThe file type is detected by checking the [magic number](https://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files) of the buffer.\n\nThis package is for detecting binary-based file formats, not text-based formats like `.txt`, `.csv`, `.svg`, etc.\n\n<br>\n\n---\n\n<div align=\"center\">\n\t<p>\n\t\t<p>\n\t\t\t<sup>\n\t\t\t\t<a href=\"https://github.com/sponsors/sindresorhus\">My open source work is supported by the community</a>\n\t\t\t</sup>\n\t\t</p>\n\t\t<sup>Special thanks to:</sup>\n\t\t<br>\n\t\t<br>\n\t\t<a href=\"https://bit.io/?utm_campaign=github_repo&utm_medium=referral&utm_content=file-type&utm_source=github\">\n\t\t\t<div>\n\t\t\t\t<img src=\"https://sindresorhus.com/assets/thanks/bitio-logo.svg\" width=\"190\" alt=\"bit.io\">\n\t\t\t</div>\n\t\t\t<b>Instant, shareable cloud PostgreSQL database</b>\n\t\t\t<div>\n\t\t\t\t<sup>Import any dataset in seconds, share with anyone with a click, try without signing up</sup>\n\t\t\t</div>\n\t\t</a>\n\t</p>\n</div>\n\n---\n\n<br>\n\n## Install\n\n```\n$ npm install file-type\n```\n\n## Usage\n\n#### Node.js\n\nDetermine file type from a file:\n\n```js\nconst FileType = require('file-type');\n\n(async () => {\n\tconsole.log(await FileType.fromFile('Unicorn.png'));\n\t//=> {ext: 'png', mime: 'image/png'}\n})();\n```\n\nDetermine file type from a Buffer, which may be a portion of the beginning of a file:\n\n```js\nconst FileType = require('file-type');\nconst readChunk = require('read-chunk');\n\n(async () => {\n\tconst buffer = readChunk.sync('Unicorn.png', 0, 4100);\n\n\tconsole.log(await FileType.fromBuffer(buffer));\n\t//=> {ext: 'png', mime: 'image/png'}\n})();\n```\n\nDetermine file type from a stream:\n\n```js\nconst fs = require('fs');\nconst FileType = require('file-type');\n\n(async () => {\n\tconst stream = fs.createReadStream('Unicorn.mp4');\n\n\tconsole.log(await FileType.fromStream(stream));\n\t//=> {ext: 'mp4', mime: 'video/mp4'}\n}\n)();\n```\n\nThe stream method can also be used to read from a remote location:\n\n```js\nconst got = require('got');\nconst FileType = require('file-type');\n\nconst url = 'https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg';\n\n(async () => {\n\tconst stream = got.stream(url);\n\n\tconsole.log(await FileType.fromStream(stream));\n\t//=> {ext: 'jpg', mime: 'image/jpeg'}\n})();\n```\n\nAnother stream example:\n\n```js\nconst stream = require('stream');\nconst fs = require('fs');\nconst crypto = require('crypto');\nconst FileType = require('file-type');\n\n(async () => {\n\tconst read = fs.createReadStream('encrypted.enc');\n\tconst decipher = crypto.createDecipheriv(alg, key, iv);\n\n\tconst fileTypeStream = await FileType.stream(stream.pipeline(read, decipher));\n\n\tconsole.log(fileTypeStream.fileType);\n\t//=> {ext: 'mov', mime: 'video/quicktime'}\n\n\tconst write = fs.createWriteStream(`decrypted.${fileTypeStream.fileType.ext}`);\n\tfileTypeStream.pipe(write);\n})();\n```\n\n#### Browser\n\n```js\nconst FileType = require('file-type/browser');\n\nconst url = 'https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg';\n\n(async () => {\n\tconst response = await fetch(url);\n\tconst fileType = await FileType.fromStream(response.body);\n\n\tconsole.log(fileType);\n\t//=> {ext: 'jpg', mime: 'image/jpeg'}\n})();\n```\n\n```js\nconst FileType = require('file-type/browser');\n\n(async () => {\n\tconst blob = new Blob(['<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>'], {\n\t\ttype: 'plain/text',\n\t\tendings: 'native'\n\t});\n\n\tconsole.log(await FileType.fromBlob(blob));\n\t//=> {ext: 'txt', mime: 'plain/text'}\n})();\n```\n\n## API\n\n### FileType.fromBuffer(buffer)\n\nDetect the file type of a `Buffer`, `Uint8Array`, or `ArrayBuffer`.\n\nThe file type is detected by checking the [magic number](https://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files) of the buffer.\n\nIf file access is available, it is recommended to use `FileType.fromFile()` instead.\n\nReturns a `Promise` for an object with the detected file type and MIME type:\n\n- `ext` - One of the [supported file types](#supported-file-types)\n- `mime` - The [MIME type](https://en.wikipedia.org/wiki/Internet_media_type)\n\nOr `undefined` when there is no match.\n\n#### buffer\n\nType: `Buffer | Uint8Array | ArrayBuffer`\n\nA buffer representing file data. It works best if the buffer contains the entire file, it may work with a smaller portion as well.\n\n### FileType.fromFile(filePath)\n\nDetect the file type of a file path.\n\nThe file type is detected by checking the [magic number](https://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files) of the buffer.\n\nReturns a `Promise` for an object with the detected file type and MIME type:\n\n- `ext` - One of the [supported file types](#supported-file-types)\n- `mime` - The [MIME type](https://en.wikipedia.org/wiki/Internet_media_type)\n\nOr `undefined` when there is no match.\n\n#### filePath\n\nType: `string`\n\nThe file path to parse.\n\n### FileType.fromStream(stream)\n\nDetect the file type of a Node.js [readable stream](https://nodejs.org/api/stream.html#stream_class_stream_readable).\n\nThe file type is detected by checking the [magic number](https://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files) of the buffer.\n\nReturns a `Promise` for an object with the detected file type and MIME type:\n\n- `ext` - One of the [supported file types](#supported-file-types)\n- `mime` - The [MIME type](https://en.wikipedia.org/wiki/Internet_media_type)\n\nOr `undefined` when there is no match.\n\n#### stream\n\nType: [`stream.Readable`](https://nodejs.org/api/stream.html#stream_class_stream_readable)\n\nA readable stream representing file data.\n\n### FileType.fromTokenizer(tokenizer)\n\nDetect the file type from an `ITokenizer` source.\n\nThis method is used internally, but can also be used for a special \"tokenizer\" reader.\n\nA tokenizer propagates the internal read functions, allowing alternative transport mechanisms, to access files, to be implemented and used.\n\nReturns a `Promise` for an object with the detected file type and MIME type:\n\n- `ext` - One of the [supported file types](#supported-file-types)\n- `mime` - The [MIME type](https://en.wikipedia.org/wiki/Internet_media_type)\n\nOr `undefined` when there is no match.\n\nAn 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 can *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.\n\n```js\nconst {makeTokenizer} = require('@tokenizer/http');\nconst FileType = require('file-type');\n\nconst audioTrackUrl = 'https://test-audio.netlify.com/Various%20Artists%20-%202009%20-%20netBloc%20Vol%2024_%20tiuqottigeloot%20%5BMP3-V2%5D/01%20-%20Diablo%20Swing%20Orchestra%20-%20Heroines.mp3';\n\n(async () => {\n\tconst httpTokenizer = await makeTokenizer(audioTrackUrl);\n\tconst fileType = await FileType.fromTokenizer(httpTokenizer);\n\n\tconsole.log(fileType);\n\t//=> {ext: 'mp3', mime: 'audio/mpeg'}\n})();\n```\n\nOr use [`@tokenizer/s3`](https://github.com/Borewit/tokenizer-s3) to determine the file type of a file stored on [Amazon S3](https://aws.amazon.com/s3):\n\n```js\nconst FileType = require('file-type');\nconst S3 = require('aws-sdk/clients/s3');\nconst {makeTokenizer} = require('@tokenizer/s3');\n\n(async () => {\n\t// Initialize the S3 client\n\tconst s3 = new S3();\n\n\t// Initialize the S3 tokenizer.\n\tconst s3Tokenizer = await makeTokenizer(s3, {\n\t\tBucket: 'affectlab',\n\t\tKey: '1min_35sec.mp4'\n\t});\n\n\t// Figure out what kind of file it is.\n\tconst fileType = await FileType.fromTokenizer(s3Tokenizer);\n\tconsole.log(fileType);\n})();\n```\n\nNote that only the minimum amount of data required to determine the file type is read (okay, just a bit extra to prevent too many fragmented reads).\n\n#### tokenizer\n\nType: [`ITokenizer`](https://github.com/Borewit/strtok3#tokenizer)\n\nA file source implementing the [tokenizer interface](https://github.com/Borewit/strtok3#tokenizer).\n\n### FileType.stream(readableStream)\n\nDetect the file type of a readable stream.\n\nReturns a `Promise` which resolves to the original readable stream argument, but with an added `fileType` property, which is an object like the one returned from `FileType.fromFile()`.\n\n*Note:* This method is only available using Node.js.\n\n#### readableStream\n\nType: [`stream.Readable`](https://nodejs.org/api/stream.html#stream_class_stream_readable)\n\nThe input stream.\n\n### FileType.extensions\n\nReturns a set of supported file extensions.\n\n### FileType.mimeTypes\n\nReturns a set of supported MIME types.\n\n## Supported file types\n\n- [`jpg`](https://en.wikipedia.org/wiki/JPEG) - Joint Photographic Experts Group image\n- [`png`](https://en.wikipedia.org/wiki/Portable_Network_Graphics) - Portable Network Graphics\n- [`apng`](https://en.wikipedia.org/wiki/APNG) - Animated Portable Network Graphics\n- [`gif`](https://en.wikipedia.org/wiki/GIF) - Graphics Interchange Format\n- [`webp`](https://en.wikipedia.org/wiki/WebP) - Web Picture format\n- [`flif`](https://en.wikipedia.org/wiki/Free_Lossless_Image_Format) - Free Lossless Image Format\n- [`xcf`](https://en.wikipedia.org/wiki/XCF_(file_format)) - eXperimental Computing Facility\n- [`cr2`](https://fileinfo.com/extension/cr2) - Canon Raw image file (v2)\n- [`cr3`](https://fileinfo.com/extension/cr3) - Canon Raw image file (v3)\n- [`orf`](https://en.wikipedia.org/wiki/ORF_format) - Olympus Raw image file\n- [`arw`](https://en.wikipedia.org/wiki/Raw_image_format#ARW) - Sony Alpha Raw image file\n- [`dng`](https://en.wikipedia.org/wiki/Digital_Negative) - Adobe Digital Negative image file\n- [`nef`](https://www.nikonusa.com/en/learn-and-explore/a/products-and-innovation/nikon-electronic-format-nef.html) - Nikon Electronic Format image file\n- [`rw2`](https://en.wikipedia.org/wiki/Raw_image_format) - Panasonic RAW image file\n- [`raf`](https://en.wikipedia.org/wiki/Raw_image_format) - Fujifilm RAW image file\n- [`tif`](https://en.wikipedia.org/wiki/Tagged_Image_File_Format) - Tagged Image file\n- [`bmp`](https://en.wikipedia.org/wiki/BMP_file_format) - Bitmap image file\n- [`icns`](https://en.wikipedia.org/wiki/Apple_Icon_Image_format) - Apple Icon image\n- [`jxr`](https://en.wikipedia.org/wiki/JPEG_XR) - Joint Photographic Experts Group extended range\n- [`psd`](https://en.wikipedia.org/wiki/Adobe_Photoshop#File_format) - Adobe Photoshop document\n- [`indd`](https://en.wikipedia.org/wiki/Adobe_InDesign#File_format) - Adobe InDesign document\n- [`zip`](https://en.wikipedia.org/wiki/Zip_(file_format)) - Archive file\n- [`tar`](https://en.wikipedia.org/wiki/Tar_(computing)#File_format) - Tarball archive file\n- [`rar`](https://en.wikipedia.org/wiki/RAR_(file_format)) - Archive file\n- [`gz`](https://en.wikipedia.org/wiki/Gzip) - Archive file\n- [`bz2`](https://en.wikipedia.org/wiki/Bzip2) - Archive file\n- [`zst`](https://en.wikipedia.org/wiki/Zstandard) - Archive file\n- [`7z`](https://en.wikipedia.org/wiki/7z) - 7-Zip archive\n- [`dmg`](https://en.wikipedia.org/wiki/Apple_Disk_Image) - Apple Disk Image\n- [`mp4`](https://en.wikipedia.org/wiki/MPEG-4_Part_14#Filename_extensions) - MPEG-4 Part 14 video file\n- [`mid`](https://en.wikipedia.org/wiki/MIDI) - Musical Instrument Digital Interface file\n- [`mkv`](https://en.wikipedia.org/wiki/Matroska) - Matroska video file\n- [`webm`](https://en.wikipedia.org/wiki/WebM) - Web video file\n- [`mov`](https://en.wikipedia.org/wiki/QuickTime_File_Format) - QuickTime video file\n- [`avi`](https://en.wikipedia.org/wiki/Audio_Video_Interleave) - Audio Video Interleave file\n- [`mpg`](https://en.wikipedia.org/wiki/MPEG-1) - MPEG-1 file\n- [`mp1`](https://en.wikipedia.org/wiki/MPEG-1_Audio_Layer_I) - MPEG-1 Audio Layer I\n- [`mp2`](https://en.wikipedia.org/wiki/MPEG-1_Audio_Layer_II) - MPEG-1 Audio Layer II\n- [`mp3`](https://en.wikipedia.org/wiki/MP3) - Audio file\n- [`ogg`](https://en.wikipedia.org/wiki/Ogg) - Audio file\n- [`ogv`](https://en.wikipedia.org/wiki/Ogg) - Audio file\n- [`ogm`](https://en.wikipedia.org/wiki/Ogg) - Audio file\n- [`oga`](https://en.wikipedia.org/wiki/Ogg) - Audio file\n- [`spx`](https://en.wikipedia.org/wiki/Ogg) - Audio file\n- [`ogx`](https://en.wikipedia.org/wiki/Ogg) - Audio file\n- [`opus`](https://en.wikipedia.org/wiki/Opus_(audio_format)) - Audio file\n- [`flac`](https://en.wikipedia.org/wiki/FLAC) - Free Lossless Audio Codec\n- [`wav`](https://en.wikipedia.org/wiki/WAV) - Waveform Audio file\n- [`qcp`](https://en.wikipedia.org/wiki/QCP) - Tagged and chunked data\n- [`amr`](https://en.wikipedia.org/wiki/Adaptive_Multi-Rate_audio_codec) - Adaptive Multi-Rate audio codec\n- [`pdf`](https://en.wikipedia.org/wiki/Portable_Document_Format) - Portable Document Format\n- [`epub`](https://en.wikipedia.org/wiki/EPUB) - E-book file\n- [`mobi`](https://en.wikipedia.org/wiki/Mobipocket) - Mobipocket\n- [`exe`](https://en.wikipedia.org/wiki/.exe) - Executable file\n- [`swf`](https://en.wikipedia.org/wiki/SWF) - Adobe Flash Player file\n- [`rtf`](https://en.wikipedia.org/wiki/Rich_Text_Format) - Rich Text Format\n- [`woff`](https://en.wikipedia.org/wiki/Web_Open_Font_Format) - Web Open Font Format\n- [`woff2`](https://en.wikipedia.org/wiki/Web_Open_Font_Format) - Web Open Font Format\n- [`eot`](https://en.wikipedia.org/wiki/Embedded_OpenType) - Embedded OpenType font\n- [`ttf`](https://en.wikipedia.org/wiki/TrueType) - TrueType font\n- [`otf`](https://en.wikipedia.org/wiki/OpenType) - OpenType font\n- [`ico`](https://en.wikipedia.org/wiki/ICO_(file_format)) - Windows icon file\n- [`flv`](https://en.wikipedia.org/wiki/Flash_Video) - Flash video\n- [`ps`](https://en.wikipedia.org/wiki/Postscript) - Postscript\n- [`xz`](https://en.wikipedia.org/wiki/Xz) - Compressed file\n- [`sqlite`](https://www.sqlite.org/fileformat2.html) - SQLite file\n- [`nes`](https://fileinfo.com/extension/nes) - Nintendo NES ROM\n- [`crx`](https://developer.chrome.com/extensions/crx) - Google Chrome extension\n- [`xpi`](https://en.wikipedia.org/wiki/XPInstall) - XPInstall file\n- [`cab`](https://en.wikipedia.org/wiki/Cabinet_(file_format)) - Cabinet file\n- [`deb`](https://en.wikipedia.org/wiki/Deb_(file_format)) - Debian package\n- [`ar`](https://en.wikipedia.org/wiki/Ar_(Unix)) - Archive file\n- [`rpm`](https://fileinfo.com/extension/rpm) - Red Hat Package Manager file\n- [`Z`](https://fileinfo.com/extension/z) - Unix Compressed File\n- [`lz`](https://en.wikipedia.org/wiki/Lzip) - Arhive file\n- [`cfb`](https://en.wikipedia.org/wiki/Compound_File_Binary_Format) - Compount File Binary Format\n- [`mxf`](https://en.wikipedia.org/wiki/Material_Exchange_Format) - Material Exchange Format\n- [`mts`](https://en.wikipedia.org/wiki/.m2ts) - Blu-ray Disc Audio-Video MPEG-2 Transport Stream\n- [`wasm`](https://en.wikipedia.org/wiki/WebAssembly) - WebAssembly intermediate compiled format\n- [`blend`](https://wiki.blender.org/index.php/Dev:Source/Architecture/File_Format) - Blender project\n- [`bpg`](https://bellard.org/bpg/) - Better Portable Graphics file\n- [`docx`](https://en.wikipedia.org/wiki/Office_Open_XML) - Microsoft Word\n- [`pptx`](https://en.wikipedia.org/wiki/Office_Open_XML) - Microsoft Powerpoint\n- [`xlsx`](https://en.wikipedia.org/wiki/Office_Open_XML) - Microsoft Excel\n- [`jp2`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000\n- [`jpm`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000\n- [`jpx`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000\n- [`mj2`](https://en.wikipedia.org/wiki/Motion_JPEG_2000) - Motion JPEG 2000\n- [`aif`](https://en.wikipedia.org/wiki/Audio_Interchange_File_Format) - Audio Interchange file\n- [`odt`](https://en.wikipedia.org/wiki/OpenDocument) - OpenDocument for word processing\n- [`ods`](https://en.wikipedia.org/wiki/OpenDocument) - OpenDocument for spreadsheets\n- [`odp`](https://en.wikipedia.org/wiki/OpenDocument) - OpenDocument for presentations\n- [`xml`](https://en.wikipedia.org/wiki/XML) - eXtensible Markup Language\n- [`heic`](https://nokiatech.github.io/heif/technical.html) - High Efficiency Image File Format\n- [`cur`](https://en.wikipedia.org/wiki/ICO_(file_format)) - Icon file\n- [`ktx`](https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/) - OpenGL and OpenGL ES textures\n- [`ape`](https://en.wikipedia.org/wiki/Monkey%27s_Audio) - Monkey's Audio\n- [`wv`](https://en.wikipedia.org/wiki/WavPack) - WavPack\n- [`asf`](https://en.wikipedia.org/wiki/Advanced_Systems_Format) - Advanced Systems Format\n- [`dcm`](https://en.wikipedia.org/wiki/DICOM#Data_format) - DICOM Image File\n- [`mpc`](https://en.wikipedia.org/wiki/Musepack) - Musepack (SV7 & SV8)\n- [`ics`](https://en.wikipedia.org/wiki/ICalendar#Data_format) - iCalendar\n- [`vcf`](https://en.wikipedia.org/wiki/VCard) - vCard\n- [`glb`](https://github.com/KhronosGroup/glTF) - GL Transmission Format\n- [`pcap`](https://wiki.wireshark.org/Development/LibpcapFileFormat) - Libpcap File Format\n- [`dsf`](https://dsd-guide.com/sites/default/files/white-papers/DSFFileFormatSpec_E.pdf) - Sony DSD Stream File (DSF)\n- [`lnk`](https://en.wikipedia.org/wiki/Shortcut_%28computing%29#Microsoft_Windows) - Microsoft Windows file shortcut\n- [`alias`](https://en.wikipedia.org/wiki/Alias_%28Mac_OS%29) - macOS Alias file\n- [`voc`](https://wiki.multimedia.cx/index.php/Creative_Voice) - Creative Voice File\n- [`ac3`](https://www.atsc.org/standard/a522012-digital-audio-compression-ac-3-e-ac-3-standard-12172012/) - ATSC A/52 Audio File\n- [`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\n- [`3g2`](https://en.wikipedia.org/wiki/3GP_and_3G2#3G2) - Multimedia container format defined by the 3GPP2 for 3G CDMA2000 multimedia services\n- [`m4v`](https://en.wikipedia.org/wiki/M4V) -  MPEG-4 Visual bitstreams\n- [`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\n- [`m4a`](https://en.wikipedia.org/wiki/M4A) - Audio-only MPEG-4 files\n- [`m4b`](https://en.wikipedia.org/wiki/M4B) - Audiobook and podcast MPEG-4 files, which also contain metadata including chapter markers, images, and hyperlinks\n- [`f4v`](https://en.wikipedia.org/wiki/Flash_Video) - ISO base media file format used by Adobe Flash Player\n- [`f4p`](https://en.wikipedia.org/wiki/Flash_Video) - ISO base media file format protected by Adobe Access DRM used by Adobe Flash Player\n- [`f4a`](https://en.wikipedia.org/wiki/Flash_Video) - Audio-only ISO base media file format used by Adobe Flash Player\n- [`f4b`](https://en.wikipedia.org/wiki/Flash_Video) - Audiobook and podcast ISO base media file format used by Adobe Flash Player\n- [`mie`](https://en.wikipedia.org/wiki/Sidecar_file) - Dedicated meta information format which supports storage of binary as well as textual meta information\n- [`shp`](https://en.wikipedia.org/wiki/Shapefile) - Geospatial vector data format\n- [`arrow`](https://arrow.apache.org) - Columnar format for tables of data\n- [`aac`](https://en.wikipedia.org/wiki/Advanced_Audio_Coding) - Advanced Audio Coding\n- [`it`](https://wiki.openmpt.org/Manual:_Module_formats#The_Impulse_Tracker_format_.28.it.29) - Audio module format: Impulse Tracker\n- [`s3m`](https://wiki.openmpt.org/Manual:_Module_formats#The_ScreamTracker_3_format_.28.s3m.29) - Audio module format: ScreamTracker 3\n- [`xm`](https://wiki.openmpt.org/Manual:_Module_formats#The_FastTracker_2_format_.28.xm.29) - Audio module format: FastTracker 2\n- [`ai`](https://en.wikipedia.org/wiki/Adobe_Illustrator_Artwork) - Adobe Illustrator Artwork\n- [`skp`](https://en.wikipedia.org/wiki/SketchUp) - SketchUp\n- [`avif`](https://en.wikipedia.org/wiki/AV1#AV1_Image_File_Format_(AVIF)) - AV1 Image File Format\n- [`eps`](https://en.wikipedia.org/wiki/Encapsulated_PostScript) - Encapsulated PostScript\n- [`lzh`](https://en.wikipedia.org/wiki/LHA_(file_format)) - LZH archive\n- [`pgp`](https://en.wikipedia.org/wiki/Pretty_Good_Privacy) - Pretty Good Privacy\n- [`asar`](https://github.com/electron/asar#format) - Archive format primarily used to enclose Electron applications\n- [`stl`](https://en.wikipedia.org/wiki/STL_(file_format)) - Standard Tesselated Geometry File Format (ASCII only)\n- [`chm`](https://en.wikipedia.org/wiki/Microsoft_Compiled_HTML_Help) - Microsoft Compiled HTML Help\n- [`3mf`](https://en.wikipedia.org/wiki/3D_Manufacturing_Format) - 3D Manufacturing Format\n- [`jxl`](https://en.wikipedia.org/wiki/JPEG_XL) - JPEG XL image format\n\n*Pull requests are welcome for additional commonly used file types.*\n\nThe following file types will not be accepted:\n- [MS-CFB: Microsoft Compound File Binary File Format based formats](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-cfb/53989ce4-7b05-4f8d-829b-d08d6148375b), too old and difficult to parse:\n\t- `.doc` - Microsoft Word 97-2003 Document\n\t- `.xls` - Microsoft Excel 97-2003 Document\n\t- `.ppt` - Microsoft PowerPoint97-2003 Document\n\t- `.msi` - Microsoft Windows Installer\n- `.csv` - [Reason.](https://github.com/sindresorhus/file-type/issues/264#issuecomment-568439196)\n- `.svg` - Detecting it requires a full-blown parser. Check out [`is-svg`](https://github.com/sindresorhus/is-svg) for something that mostly works.\n\n## file-type for enterprise\n\nAvailable as part of the Tidelift Subscription.\n\nThe maintainers of file-type and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-file-type?utm_source=npm-file-type&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)\n\n## Related\n\n- [file-type-cli](https://github.com/sindresorhus/file-type-cli) - CLI for this module\n\n## Maintainers\n\n- [Sindre Sorhus](https://github.com/sindresorhus)\n- [Mikael Finstad](https://github.com/mifi)\n- [Ben Brook](https://github.com/bencmbrook)\n- [Borewit](https://github.com/Borewit)\n","readmeFilename":"readme.md","gitHead":"b5fe3b9596711a42c0141d97a11e4f0fa5fcc7a0","bugs":{"url":"https://github.com/sindresorhus/file-type/issues"},"homepage":"https://github.com/sindresorhus/file-type#readme","_id":"file-type@16.5.4","_nodeVersion":"14.19.3","_npmVersion":"8.3.2","dist":{"integrity":"sha512-/yFHK0aGjFEgDJjEKP0pWCplsPFPhwyfwevf/pVxiN0tmE4L9LmwWxWukdJSHdoCli4VgQLehjJtwQBnqmsKcw==","shasum":"474fb4f704bee427681f98dd390058a172a6c2fd","tarball":"http://registry-npm.ywwl.com/file-type/download/file-type-16.5.4.tgz","fileCount":11,"unpackedSize":76681,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHCc77nTx2wIDU/GLVcCeIFZvqyqYrMiP9Zevuyl5ofsAiEAgAX+GqLgR7DWweBIVhHapUqjpDn36QAA9JjqZz8DCdE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2WQ3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqV9A//Zgb56HRDm3cRPzGJU8sl1Vfee2WaWDXQZwliy+dllP7plMda\r\n2Z6alf65JRKoZW7gXshz2ca374hQSSzscU1/0Vsww4ceIa2/0f7hb7+HvN3z\r\nTeq1PPcxgPLq1Pxa8I63u4q8/8/TiZJt1zqw4fvXudTrFghR6KY6Xm5daNYR\r\njdMJNWKzB8NJF6bmRztwIsTteAsUrz8GBorKGiRYeh29yNcNYEM1P02iRORN\r\nUJN6uCjgTVJujDLylav8f3opkh/vAjwaCp+IHLloU2cofYGtIgHKf78pRq5I\r\nVLVidEARSk1Ljeegcck2Hs0KoRb6Ytn5P8br3KLj0Opv56OqbNNm2e1ayGeI\r\nA0F+O6pdo3Wpct2l5V2hvowYk7DmB5LNzumzcT9eF0c3Vg0Og50D/mKoH6Mm\r\nNo71/erreGPdAZTxFJMgQbAQXOQVnXBkuSmFNvIpz+2euKQFNJxmMcIrsKUZ\r\n69tCDcR17e1WzHQ2qy5Xp06YYQrT8P3iThiZxrLKkYIm7qZSmxtlvdsrK65r\r\nj3Msg4hCmFk27xbV8jB8m/r/OmXXn3HjlVE9DM+AOBGjOd4ODr/V88OzjjFB\r\ntn1eULC5zO1pOy+2CJoNbTa0384A2J/aMon/XKEYT3sW8YVG6IoBjLWNhg0R\r\nASBx20b9brqUH7tXi2kt/bG5ayCGZ0aTtt4=\r\n=MEir\r\n-----END PGP SIGNATURE-----\r\n","size":20909,"noattachment":false,"key":"/file-type/-/file-type-16.5.4.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"},{"name":"mifi","email":"finstaden@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/file-type_16.5.4_1658414135221_0.6323959238850685"},"_hasShrinkwrap":false,"publish_time":1658414135346,"_cnpm_publish_time":1658414135346,"dist-tags":{"latest":"22.3.0","version-16":"16.5.4"}}