@dragon708/docmind-markdown 1.2.5 → 1.2.7

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.
Files changed (328) hide show
  1. package/node_modules/music-metadata/LICENSE.txt +3 -3
  2. package/node_modules/music-metadata/README.md +246 -690
  3. package/node_modules/music-metadata/lib/ParserFactory.d.ts +31 -27
  4. package/node_modules/music-metadata/lib/ParserFactory.js +219 -108
  5. package/node_modules/music-metadata/lib/aiff/AiffParser.d.ts +2 -2
  6. package/node_modules/music-metadata/lib/aiff/AiffParser.js +38 -34
  7. package/node_modules/music-metadata/lib/aiff/AiffTagMap.d.ts +1 -1
  8. package/node_modules/music-metadata/lib/aiff/AiffTagMap.js +7 -2
  9. package/node_modules/music-metadata/lib/aiff/AiffToken.d.ts +6 -32
  10. package/node_modules/music-metadata/lib/aiff/AiffToken.js +17 -27
  11. package/node_modules/music-metadata/lib/apev2/APEv2Parser.d.ts +8 -24
  12. package/node_modules/music-metadata/lib/apev2/APEv2Parser.js +66 -78
  13. package/node_modules/music-metadata/lib/apev2/APEv2TagMapper.d.ts +1 -1
  14. package/node_modules/music-metadata/lib/apev2/APEv2TagMapper.js +8 -4
  15. package/node_modules/music-metadata/lib/apev2/APEv2Token.d.ts +11 -10
  16. package/node_modules/music-metadata/lib/apev2/APEv2Token.js +27 -16
  17. package/node_modules/music-metadata/lib/asf/AsfObject.d.ts +53 -59
  18. package/node_modules/music-metadata/lib/asf/AsfObject.js +131 -97
  19. package/node_modules/music-metadata/lib/asf/AsfParser.d.ts +1 -1
  20. package/node_modules/music-metadata/lib/asf/AsfParser.js +43 -42
  21. package/node_modules/music-metadata/lib/asf/AsfTagMapper.d.ts +2 -2
  22. package/node_modules/music-metadata/lib/asf/AsfTagMapper.js +10 -6
  23. package/node_modules/music-metadata/lib/asf/AsfUtil.d.ts +13 -4
  24. package/node_modules/music-metadata/lib/asf/AsfUtil.js +36 -30
  25. package/node_modules/music-metadata/lib/asf/GUID.d.ts +84 -0
  26. package/node_modules/music-metadata/lib/asf/GUID.js +121 -0
  27. package/node_modules/music-metadata/lib/common/BasicParser.d.ts +9 -9
  28. package/node_modules/music-metadata/lib/common/BasicParser.js +7 -2
  29. package/node_modules/music-metadata/lib/common/CaseInsensitiveTagMap.d.ts +3 -3
  30. package/node_modules/music-metadata/lib/common/CaseInsensitiveTagMap.js +7 -2
  31. package/node_modules/music-metadata/lib/common/CombinedTagMapper.d.ts +5 -5
  32. package/node_modules/music-metadata/lib/common/CombinedTagMapper.js +28 -24
  33. package/node_modules/music-metadata/lib/common/FourCC.d.ts +1 -1
  34. package/node_modules/music-metadata/lib/common/FourCC.js +11 -10
  35. package/node_modules/music-metadata/lib/common/GenericTagMapper.d.ts +13 -13
  36. package/node_modules/music-metadata/lib/common/GenericTagMapper.js +12 -7
  37. package/node_modules/music-metadata/lib/common/GenericTagTypes.d.ts +6 -7
  38. package/node_modules/music-metadata/lib/common/GenericTagTypes.js +85 -86
  39. package/node_modules/music-metadata/lib/common/MetadataCollector.d.ts +10 -20
  40. package/node_modules/music-metadata/lib/common/MetadataCollector.js +69 -100
  41. package/node_modules/music-metadata/lib/common/RandomFileReader.d.ts +22 -0
  42. package/node_modules/music-metadata/lib/common/RandomFileReader.js +34 -0
  43. package/node_modules/music-metadata/lib/common/RandomUint8ArrayReader.d.ts +18 -0
  44. package/node_modules/music-metadata/lib/common/RandomUint8ArrayReader.js +25 -0
  45. package/node_modules/music-metadata/lib/common/Util.d.ts +12 -11
  46. package/node_modules/music-metadata/lib/common/Util.js +53 -47
  47. package/node_modules/music-metadata/lib/core.d.ts +15 -42
  48. package/node_modules/music-metadata/lib/core.js +38 -74
  49. package/node_modules/music-metadata/lib/dsdiff/DsdiffParser.d.ts +1 -16
  50. package/node_modules/music-metadata/lib/dsdiff/DsdiffParser.js +44 -55
  51. package/node_modules/music-metadata/lib/dsdiff/DsdiffToken.d.ts +3 -3
  52. package/node_modules/music-metadata/lib/dsdiff/DsdiffToken.js +7 -4
  53. package/node_modules/music-metadata/lib/dsf/DsfChunk.d.ts +10 -11
  54. package/node_modules/music-metadata/lib/dsf/DsfChunk.js +19 -15
  55. package/node_modules/music-metadata/lib/dsf/DsfParser.d.ts +1 -16
  56. package/node_modules/music-metadata/lib/dsf/DsfParser.js +20 -21
  57. package/node_modules/music-metadata/lib/flac/FlacParser.d.ts +15 -16
  58. package/node_modules/music-metadata/lib/flac/FlacParser.js +119 -69
  59. package/node_modules/music-metadata/lib/id3v1/ID3v1Parser.d.ts +3 -7
  60. package/node_modules/music-metadata/lib/id3v1/ID3v1Parser.js +36 -39
  61. package/node_modules/music-metadata/lib/id3v1/ID3v1TagMap.d.ts +1 -1
  62. package/node_modules/music-metadata/lib/id3v1/ID3v1TagMap.js +7 -2
  63. package/node_modules/music-metadata/lib/id3v2/AbstractID3Parser.d.ts +2 -2
  64. package/node_modules/music-metadata/lib/id3v2/AbstractID3Parser.js +19 -15
  65. package/node_modules/music-metadata/lib/id3v2/FrameParser.d.ts +3 -64
  66. package/node_modules/music-metadata/lib/id3v2/FrameParser.js +103 -244
  67. package/node_modules/music-metadata/lib/id3v2/ID3v22TagMapper.d.ts +2 -2
  68. package/node_modules/music-metadata/lib/id3v2/ID3v22TagMapper.js +16 -6
  69. package/node_modules/music-metadata/lib/id3v2/ID3v24TagMapper.d.ts +5 -5
  70. package/node_modules/music-metadata/lib/id3v2/ID3v24TagMapper.js +35 -36
  71. package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.d.ts +6 -11
  72. package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.js +104 -91
  73. package/node_modules/music-metadata/lib/id3v2/ID3v2Token.d.ts +29 -67
  74. package/node_modules/music-metadata/lib/id3v2/ID3v2Token.js +36 -76
  75. package/node_modules/music-metadata/lib/iff/index.d.ts +1 -1
  76. package/node_modules/music-metadata/lib/iff/index.js +7 -4
  77. package/node_modules/music-metadata/lib/index.d.ts +31 -8
  78. package/node_modules/music-metadata/lib/index.js +53 -32
  79. package/node_modules/music-metadata/lib/lyrics3/Lyrics3.d.ts +2 -2
  80. package/node_modules/music-metadata/lib/lyrics3/Lyrics3.js +13 -13
  81. package/node_modules/music-metadata/lib/matroska/MatroskaDtd.d.ts +2 -2
  82. package/node_modules/music-metadata/lib/matroska/MatroskaDtd.js +242 -246
  83. package/node_modules/music-metadata/lib/matroska/MatroskaParser.d.ts +24 -6
  84. package/node_modules/music-metadata/lib/matroska/MatroskaParser.js +218 -124
  85. package/node_modules/music-metadata/lib/matroska/MatroskaTagMapper.d.ts +1 -1
  86. package/node_modules/music-metadata/lib/matroska/MatroskaTagMapper.js +7 -3
  87. package/node_modules/music-metadata/lib/matroska/types.d.ts +76 -43
  88. package/node_modules/music-metadata/lib/matroska/types.js +33 -27
  89. package/node_modules/music-metadata/lib/mp4/Atom.d.ts +7 -7
  90. package/node_modules/music-metadata/lib/mp4/Atom.js +22 -15
  91. package/node_modules/music-metadata/lib/mp4/AtomToken.d.ts +18 -110
  92. package/node_modules/music-metadata/lib/mp4/AtomToken.js +66 -184
  93. package/node_modules/music-metadata/lib/mp4/MP4Parser.d.ts +4 -6
  94. package/node_modules/music-metadata/lib/mp4/MP4Parser.js +128 -255
  95. package/node_modules/music-metadata/lib/mp4/MP4TagMapper.d.ts +4 -4
  96. package/node_modules/music-metadata/lib/mp4/MP4TagMapper.js +12 -8
  97. package/node_modules/music-metadata/lib/mpeg/ExtendedLameHeader.d.ts +5 -5
  98. package/node_modules/music-metadata/lib/mpeg/ExtendedLameHeader.js +10 -7
  99. package/node_modules/music-metadata/lib/mpeg/MpegParser.d.ts +4 -17
  100. package/node_modules/music-metadata/lib/mpeg/MpegParser.js +131 -176
  101. package/node_modules/music-metadata/lib/mpeg/ReplayGainDataFormat.d.ts +14 -16
  102. package/node_modules/music-metadata/lib/mpeg/ReplayGainDataFormat.js +19 -14
  103. package/node_modules/music-metadata/lib/mpeg/XingTag.d.ts +7 -6
  104. package/node_modules/music-metadata/lib/mpeg/XingTag.js +18 -14
  105. package/node_modules/music-metadata/lib/musepack/index.d.ts +5 -0
  106. package/node_modules/music-metadata/lib/musepack/index.js +32 -0
  107. package/node_modules/music-metadata/lib/musepack/sv7/BitReader.d.ts +2 -2
  108. package/node_modules/music-metadata/lib/musepack/sv7/BitReader.js +24 -16
  109. package/node_modules/music-metadata/lib/musepack/sv7/MpcSv7Parser.d.ts +1 -1
  110. package/node_modules/music-metadata/lib/musepack/sv7/MpcSv7Parser.js +15 -16
  111. package/node_modules/music-metadata/lib/musepack/sv7/StreamVersion7.d.ts +1 -1
  112. package/node_modules/music-metadata/lib/musepack/sv7/StreamVersion7.js +7 -5
  113. package/node_modules/music-metadata/lib/musepack/sv8/MpcSv8Parser.d.ts +1 -1
  114. package/node_modules/music-metadata/lib/musepack/sv8/MpcSv8Parser.js +17 -18
  115. package/node_modules/music-metadata/lib/musepack/sv8/StreamVersion8.d.ts +3 -5
  116. package/node_modules/music-metadata/lib/musepack/sv8/StreamVersion8.js +12 -14
  117. package/node_modules/music-metadata/lib/ogg/{OggToken.d.ts → Ogg.d.ts} +6 -17
  118. package/node_modules/music-metadata/lib/ogg/Ogg.js +2 -0
  119. package/node_modules/music-metadata/lib/ogg/OggParser.d.ts +12 -16
  120. package/node_modules/music-metadata/lib/ogg/OggParser.js +102 -101
  121. package/node_modules/music-metadata/lib/ogg/opus/Opus.d.ts +2 -17
  122. package/node_modules/music-metadata/lib/ogg/opus/Opus.js +14 -13
  123. package/node_modules/music-metadata/lib/ogg/opus/OpusParser.d.ts +25 -0
  124. package/node_modules/music-metadata/lib/ogg/opus/{OpusStream.js → OpusParser.js} +18 -18
  125. package/node_modules/music-metadata/lib/ogg/speex/Speex.d.ts +1 -1
  126. package/node_modules/music-metadata/lib/ogg/speex/Speex.js +19 -16
  127. package/node_modules/music-metadata/lib/ogg/speex/SpeexParser.d.ts +22 -0
  128. package/node_modules/music-metadata/lib/ogg/speex/{SpeexStream.js → SpeexParser.js} +13 -9
  129. package/node_modules/music-metadata/lib/ogg/theora/Theora.d.ts +1 -1
  130. package/node_modules/music-metadata/lib/ogg/theora/Theora.js +11 -8
  131. package/node_modules/music-metadata/lib/ogg/theora/TheoraParser.d.ts +28 -0
  132. package/node_modules/music-metadata/lib/ogg/theora/TheoraParser.js +44 -0
  133. package/node_modules/music-metadata/lib/ogg/vorbis/Vorbis.d.ts +7 -6
  134. package/node_modules/music-metadata/lib/ogg/vorbis/Vorbis.js +29 -34
  135. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.d.ts +1 -1
  136. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.js +9 -6
  137. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisParser.d.ts +36 -0
  138. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisParser.js +128 -0
  139. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisTagMapper.d.ts +3 -3
  140. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisTagMapper.js +9 -5
  141. package/node_modules/music-metadata/lib/riff/RiffChunk.d.ts +5 -5
  142. package/node_modules/music-metadata/lib/riff/RiffChunk.js +9 -5
  143. package/node_modules/music-metadata/lib/riff/RiffInfoTagMap.d.ts +2 -2
  144. package/node_modules/music-metadata/lib/riff/RiffInfoTagMap.js +25 -20
  145. package/node_modules/music-metadata/lib/type.d.ts +52 -121
  146. package/node_modules/music-metadata/lib/type.js +6 -2
  147. package/node_modules/music-metadata/lib/wav/BwfChunk.d.ts +1 -1
  148. package/node_modules/music-metadata/lib/wav/BwfChunk.js +11 -8
  149. package/node_modules/music-metadata/lib/wav/WaveChunk.d.ts +20 -50
  150. package/node_modules/music-metadata/lib/wav/WaveChunk.js +32 -45
  151. package/node_modules/music-metadata/lib/wav/WaveParser.d.ts +2 -2
  152. package/node_modules/music-metadata/lib/wav/WaveParser.js +39 -46
  153. package/node_modules/music-metadata/lib/wavpack/WavPackParser.d.ts +2 -18
  154. package/node_modules/music-metadata/lib/wavpack/WavPackParser.js +32 -42
  155. package/node_modules/music-metadata/lib/wavpack/WavPackToken.d.ts +18 -14
  156. package/node_modules/music-metadata/lib/wavpack/WavPackToken.js +30 -24
  157. package/node_modules/music-metadata/package.json +74 -81
  158. package/node_modules/{music-metadata/node_modules/strtok3/LICENSE.txt → turndown-plugin-gfm/LICENSE} +21 -21
  159. package/node_modules/turndown-plugin-gfm/README.md +50 -0
  160. package/node_modules/turndown-plugin-gfm/dist/turndown-plugin-gfm.js +165 -0
  161. package/node_modules/turndown-plugin-gfm/lib/turndown-plugin-gfm.browser.cjs.js +162 -0
  162. package/node_modules/turndown-plugin-gfm/lib/turndown-plugin-gfm.browser.es.js +154 -0
  163. package/node_modules/turndown-plugin-gfm/lib/turndown-plugin-gfm.cjs.js +162 -0
  164. package/node_modules/turndown-plugin-gfm/lib/turndown-plugin-gfm.es.js +154 -0
  165. package/node_modules/turndown-plugin-gfm/package.json +43 -0
  166. package/package.json +5 -5
  167. package/node_modules/@borewit/text-codec/LICENSE.txt +0 -9
  168. package/node_modules/@borewit/text-codec/README.md +0 -87
  169. package/node_modules/@borewit/text-codec/lib/index.d.ts +0 -6
  170. package/node_modules/@borewit/text-codec/lib/index.js +0 -380
  171. package/node_modules/@borewit/text-codec/package.json +0 -70
  172. package/node_modules/music-metadata/lib/ParseError.d.ts +0 -87
  173. package/node_modules/music-metadata/lib/ParseError.js +0 -38
  174. package/node_modules/music-metadata/lib/aiff/AiffLoader.d.ts +0 -2
  175. package/node_modules/music-metadata/lib/aiff/AiffLoader.js +0 -8
  176. package/node_modules/music-metadata/lib/apev2/Apev2Loader.d.ts +0 -2
  177. package/node_modules/music-metadata/lib/apev2/Apev2Loader.js +0 -8
  178. package/node_modules/music-metadata/lib/asf/AsfGuid.d.ts +0 -83
  179. package/node_modules/music-metadata/lib/asf/AsfGuid.js +0 -109
  180. package/node_modules/music-metadata/lib/asf/AsfLoader.d.ts +0 -2
  181. package/node_modules/music-metadata/lib/asf/AsfLoader.js +0 -8
  182. package/node_modules/music-metadata/lib/dsdiff/DsdiffLoader.d.ts +0 -2
  183. package/node_modules/music-metadata/lib/dsdiff/DsdiffLoader.js +0 -8
  184. package/node_modules/music-metadata/lib/dsf/DsfLoader.d.ts +0 -2
  185. package/node_modules/music-metadata/lib/dsf/DsfLoader.js +0 -8
  186. package/node_modules/music-metadata/lib/ebml/EbmlIterator.d.ts +0 -67
  187. package/node_modules/music-metadata/lib/ebml/EbmlIterator.js +0 -218
  188. package/node_modules/music-metadata/lib/ebml/types.d.ts +0 -37
  189. package/node_modules/music-metadata/lib/ebml/types.js +0 -8
  190. package/node_modules/music-metadata/lib/flac/FlacLoader.d.ts +0 -2
  191. package/node_modules/music-metadata/lib/flac/FlacLoader.js +0 -8
  192. package/node_modules/music-metadata/lib/flac/FlacToken.d.ts +0 -45
  193. package/node_modules/music-metadata/lib/flac/FlacToken.js +0 -63
  194. package/node_modules/music-metadata/lib/id3v2/FrameHeader.d.ts +0 -31
  195. package/node_modules/music-metadata/lib/id3v2/FrameHeader.js +0 -73
  196. package/node_modules/music-metadata/lib/id3v2/ID3v2ChapterToken.d.ts +0 -11
  197. package/node_modules/music-metadata/lib/id3v2/ID3v2ChapterToken.js +0 -17
  198. package/node_modules/music-metadata/lib/lrc/LyricsParser.d.ts +0 -9
  199. package/node_modules/music-metadata/lib/lrc/LyricsParser.js +0 -45
  200. package/node_modules/music-metadata/lib/matroska/MatroskaLoader.d.ts +0 -2
  201. package/node_modules/music-metadata/lib/matroska/MatroskaLoader.js +0 -8
  202. package/node_modules/music-metadata/lib/mp4/Mp4Loader.d.ts +0 -2
  203. package/node_modules/music-metadata/lib/mp4/Mp4Loader.js +0 -8
  204. package/node_modules/music-metadata/lib/mpeg/MpegLoader.d.ts +0 -2
  205. package/node_modules/music-metadata/lib/mpeg/MpegLoader.js +0 -8
  206. package/node_modules/music-metadata/lib/musepack/MusepackConentError.d.ts +0 -15
  207. package/node_modules/music-metadata/lib/musepack/MusepackConentError.js +0 -3
  208. package/node_modules/music-metadata/lib/musepack/MusepackLoader.d.ts +0 -2
  209. package/node_modules/music-metadata/lib/musepack/MusepackLoader.js +0 -8
  210. package/node_modules/music-metadata/lib/musepack/MusepackParser.d.ts +0 -4
  211. package/node_modules/music-metadata/lib/musepack/MusepackParser.js +0 -30
  212. package/node_modules/music-metadata/lib/ogg/OggLoader.d.ts +0 -2
  213. package/node_modules/music-metadata/lib/ogg/OggLoader.js +0 -8
  214. package/node_modules/music-metadata/lib/ogg/OggToken.js +0 -41
  215. package/node_modules/music-metadata/lib/ogg/flac/FlacStream.d.ts +0 -29
  216. package/node_modules/music-metadata/lib/ogg/flac/FlacStream.js +0 -74
  217. package/node_modules/music-metadata/lib/ogg/opus/OpusStream.d.ts +0 -24
  218. package/node_modules/music-metadata/lib/ogg/speex/SpeexStream.d.ts +0 -20
  219. package/node_modules/music-metadata/lib/ogg/theora/TheoraStream.d.ts +0 -25
  220. package/node_modules/music-metadata/lib/ogg/theora/TheoraStream.js +0 -39
  221. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.d.ts +0 -53
  222. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.js +0 -136
  223. package/node_modules/music-metadata/lib/wav/WaveLoader.d.ts +0 -2
  224. package/node_modules/music-metadata/lib/wav/WaveLoader.js +0 -8
  225. package/node_modules/music-metadata/lib/wavpack/WavPackLoader.d.ts +0 -2
  226. package/node_modules/music-metadata/lib/wavpack/WavPackLoader.js +0 -8
  227. package/node_modules/music-metadata/node_modules/file-type/core.d.ts +0 -253
  228. package/node_modules/music-metadata/node_modules/file-type/core.js +0 -2899
  229. package/node_modules/music-metadata/node_modules/file-type/index.d.ts +0 -98
  230. package/node_modules/music-metadata/node_modules/file-type/index.js +0 -163
  231. package/node_modules/music-metadata/node_modules/file-type/license +0 -9
  232. package/node_modules/music-metadata/node_modules/file-type/package.json +0 -290
  233. package/node_modules/music-metadata/node_modules/file-type/readme.md +0 -667
  234. package/node_modules/music-metadata/node_modules/file-type/supported.js +0 -360
  235. package/node_modules/music-metadata/node_modules/file-type/util.js +0 -60
  236. package/node_modules/music-metadata/node_modules/strtok3/README.md +0 -399
  237. package/node_modules/music-metadata/node_modules/strtok3/lib/AbstractTokenizer.d.ts +0 -76
  238. package/node_modules/music-metadata/node_modules/strtok3/lib/AbstractTokenizer.js +0 -111
  239. package/node_modules/music-metadata/node_modules/strtok3/lib/BlobTokenizer.d.ts +0 -29
  240. package/node_modules/music-metadata/node_modules/strtok3/lib/BlobTokenizer.js +0 -53
  241. package/node_modules/music-metadata/node_modules/strtok3/lib/BufferTokenizer.d.ts +0 -29
  242. package/node_modules/music-metadata/node_modules/strtok3/lib/BufferTokenizer.js +0 -52
  243. package/node_modules/music-metadata/node_modules/strtok3/lib/FileTokenizer.d.ts +0 -37
  244. package/node_modules/music-metadata/node_modules/strtok3/lib/FileTokenizer.js +0 -61
  245. package/node_modules/music-metadata/node_modules/strtok3/lib/ReadStreamTokenizer.d.ts +0 -34
  246. package/node_modules/music-metadata/node_modules/strtok3/lib/ReadStreamTokenizer.js +0 -107
  247. package/node_modules/music-metadata/node_modules/strtok3/lib/core.d.ts +0 -40
  248. package/node_modules/music-metadata/node_modules/strtok3/lib/core.js +0 -62
  249. package/node_modules/music-metadata/node_modules/strtok3/lib/index.d.ts +0 -16
  250. package/node_modules/music-metadata/node_modules/strtok3/lib/index.js +0 -22
  251. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/AbstractStreamReader.d.ts +0 -54
  252. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/AbstractStreamReader.js +0 -71
  253. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/Deferred.d.ts +0 -6
  254. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/Deferred.js +0 -10
  255. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/Errors.d.ts +0 -10
  256. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/Errors.js +0 -16
  257. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/StreamReader.d.ts +0 -29
  258. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/StreamReader.js +0 -83
  259. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamByobReader.d.ts +0 -14
  260. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamByobReader.js +0 -27
  261. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamDefaultReader.d.ts +0 -19
  262. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamDefaultReader.js +0 -62
  263. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamReader.d.ts +0 -14
  264. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamReader.js +0 -13
  265. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamReaderFactory.d.ts +0 -5
  266. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/WebStreamReaderFactory.js +0 -19
  267. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/index.d.ts +0 -6
  268. package/node_modules/music-metadata/node_modules/strtok3/lib/stream/index.js +0 -5
  269. package/node_modules/music-metadata/node_modules/strtok3/lib/types.d.ts +0 -139
  270. package/node_modules/music-metadata/node_modules/strtok3/lib/types.js +0 -1
  271. package/node_modules/music-metadata/node_modules/strtok3/package.json +0 -94
  272. package/node_modules/music-metadata/node_modules/token-types/LICENSE.txt +0 -9
  273. package/node_modules/music-metadata/node_modules/token-types/README.md +0 -120
  274. package/node_modules/music-metadata/node_modules/token-types/lib/index.d.ts +0 -135
  275. package/node_modules/music-metadata/node_modules/token-types/lib/index.js +0 -401
  276. package/node_modules/music-metadata/node_modules/token-types/package.json +0 -81
  277. package/node_modules/sprintf-js/.npmignore +0 -1
  278. package/node_modules/sprintf-js/LICENSE +0 -24
  279. package/node_modules/sprintf-js/README.md +0 -88
  280. package/node_modules/sprintf-js/bower.json +0 -14
  281. package/node_modules/sprintf-js/demo/angular.html +0 -20
  282. package/node_modules/sprintf-js/dist/angular-sprintf.min.js +0 -4
  283. package/node_modules/sprintf-js/dist/angular-sprintf.min.js.map +0 -1
  284. package/node_modules/sprintf-js/dist/angular-sprintf.min.map +0 -1
  285. package/node_modules/sprintf-js/dist/sprintf.min.js +0 -4
  286. package/node_modules/sprintf-js/dist/sprintf.min.js.map +0 -1
  287. package/node_modules/sprintf-js/dist/sprintf.min.map +0 -1
  288. package/node_modules/sprintf-js/gruntfile.js +0 -36
  289. package/node_modules/sprintf-js/package.json +0 -22
  290. package/node_modules/sprintf-js/src/angular-sprintf.js +0 -18
  291. package/node_modules/sprintf-js/src/sprintf.js +0 -208
  292. package/node_modules/sprintf-js/test/test.js +0 -82
  293. package/node_modules/uint8array-extras/index.d.ts +0 -331
  294. package/node_modules/uint8array-extras/index.js +0 -318
  295. package/node_modules/uint8array-extras/license +0 -9
  296. package/node_modules/uint8array-extras/package.json +0 -54
  297. package/node_modules/uint8array-extras/readme.md +0 -318
  298. package/node_modules/win-guid/LICENSE.txt +0 -9
  299. package/node_modules/win-guid/README.md +0 -113
  300. package/node_modules/win-guid/lib/guid.d.ts +0 -20
  301. package/node_modules/win-guid/lib/guid.js +0 -107
  302. package/node_modules/win-guid/package.json +0 -55
  303. /package/node_modules/{argparse → mammoth/node_modules/argparse}/LICENSE +0 -0
  304. /package/node_modules/{argparse → mammoth/node_modules/argparse}/README.md +0 -0
  305. /package/node_modules/{argparse → mammoth/node_modules/argparse}/index.js +0 -0
  306. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/append/constant.js +0 -0
  307. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/append.js +0 -0
  308. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/count.js +0 -0
  309. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/help.js +0 -0
  310. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/store/constant.js +0 -0
  311. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/store/false.js +0 -0
  312. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/store/true.js +0 -0
  313. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/store.js +0 -0
  314. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/subparsers.js +0 -0
  315. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action/version.js +0 -0
  316. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action.js +0 -0
  317. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/action_container.js +0 -0
  318. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/argparse.js +0 -0
  319. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/argument/error.js +0 -0
  320. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/argument/exclusive.js +0 -0
  321. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/argument/group.js +0 -0
  322. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/argument_parser.js +0 -0
  323. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/const.js +0 -0
  324. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/help/added_formatters.js +0 -0
  325. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/help/formatter.js +0 -0
  326. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/namespace.js +0 -0
  327. /package/node_modules/{argparse → mammoth/node_modules/argparse}/lib/utils.js +0 -0
  328. /package/node_modules/{argparse → mammoth/node_modules/argparse}/package.json +0 -0
@@ -1,667 +0,0 @@
1
- <h1 align="center" title="file-type">
2
- <img src="media/logo.jpg" alt="file-type logo">
3
- </h1>
4
-
5
- > Detect the file type of a file, stream, or data
6
-
7
- 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.
8
-
9
- This package is for detecting binary-based file formats, not text-based formats like `.txt`, `.csv`, `.svg`, etc.
10
-
11
- We accept contributions for commonly used modern file formats, not historical or obscure ones. Open an issue first for discussion.
12
-
13
- > [!IMPORTANT]
14
- > NO SECURITY REPORTS WILL BE ACCEPTED RIGHT NOW. I'm currently hardening the parser and all the low-quality AI-generated security reports is just a huge waste of time.
15
-
16
- ## Install
17
-
18
- ```sh
19
- npm install file-type
20
- ```
21
-
22
- **This package is an ESM package. Your project needs to be ESM too. [Read more](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). For TypeScript + CommonJS, see [`load-esm`](https://github.com/Borewit/load-esm).** If you use it with Webpack, you need the latest Webpack version and ensure you configure it correctly for ESM.
23
-
24
- > [!IMPORTANT]
25
- > File type detection is based on binary signatures (magic numbers) and is a best-effort hint. It does not guarantee the file is actually of that type or that the file is valid/not malformed.
26
- >
27
- > Robustness against malformed input is best-effort. When processing untrusted files on a server, enforce a reasonable file size limit and use a worker thread with a timeout (e.g., [`make-asynchronous`](https://github.com/sindresorhus/make-asynchronous)). These are not considered security issues in this package.
28
-
29
- ## Usage
30
-
31
- ### Node.js
32
-
33
- Determine file type from a file:
34
-
35
- ```js
36
- import {fileTypeFromFile} from 'file-type';
37
-
38
- console.log(await fileTypeFromFile('Unicorn.png'));
39
- //=> {ext: 'png', mime: 'image/png'}
40
- ```
41
-
42
- Determine file type from a Uint8Array/ArrayBuffer, which may be a portion of the beginning of a file:
43
-
44
- ```js
45
- import {fileTypeFromBuffer} from 'file-type';
46
- import {readChunk} from 'read-chunk';
47
-
48
- const buffer = await readChunk('Unicorn.png', {length: 4100});
49
-
50
- console.log(await fileTypeFromBuffer(buffer));
51
- //=> {ext: 'png', mime: 'image/png'}
52
- ```
53
-
54
- Determine file type from a stream:
55
-
56
- ```js
57
- import fs from 'node:fs';
58
- import {fileTypeFromStream} from 'file-type';
59
-
60
- const stream = fs.createReadStream('Unicorn.mp4');
61
-
62
- console.log(await fileTypeFromStream(stream));
63
- //=> {ext: 'mp4', mime: 'video/mp4'}
64
- ```
65
-
66
- The stream method can also be used to read from a remote location:
67
-
68
- ```js
69
- import got from 'got';
70
- import {fileTypeFromStream} from 'file-type';
71
-
72
- const url = 'https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg';
73
-
74
- const stream = got.stream(url);
75
-
76
- console.log(await fileTypeFromStream(stream));
77
- //=> {ext: 'jpg', mime: 'image/jpeg'}
78
- ```
79
-
80
- Another stream example:
81
-
82
- ```js
83
- import stream from 'node:stream';
84
- import fs from 'node:fs';
85
- import crypto from 'node:crypto';
86
- import {fileTypeStream} from 'file-type';
87
-
88
- const read = fs.createReadStream('encrypted.enc');
89
- const decipher = crypto.createDecipheriv(alg, key, iv);
90
-
91
- const streamWithFileType = await fileTypeStream(stream.pipeline(read, decipher));
92
-
93
- console.log(streamWithFileType.fileType);
94
- //=> {ext: 'mov', mime: 'video/quicktime'}
95
-
96
- const write = fs.createWriteStream(`decrypted.${streamWithFileType.fileType.ext}`);
97
- streamWithFileType.pipe(write);
98
- ```
99
-
100
- ### Browser
101
-
102
- ```js
103
- import {fileTypeFromStream} from 'file-type';
104
-
105
- const url = 'https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg';
106
-
107
- const response = await fetch(url);
108
- const fileType = await fileTypeFromStream(response.body);
109
-
110
- console.log(fileType);
111
- //=> {ext: 'jpg', mime: 'image/jpeg'}
112
- ```
113
-
114
- ## API
115
-
116
- ### fileTypeFromBuffer(buffer, options)
117
-
118
- Detect the file type of a `Uint8Array`, or `ArrayBuffer`.
119
-
120
- 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.
121
-
122
- If file access is available, it is recommended to use `fileTypeFromFile()` instead.
123
-
124
- Returns a `Promise` for an object with the detected file type:
125
-
126
- - `ext` - One of the [supported file types](#supported-file-types)
127
- - `mime` - The [MIME type](https://en.wikipedia.org/wiki/Internet_media_type)
128
-
129
- Or `undefined` when there is no match.
130
-
131
- #### buffer
132
-
133
- Type: `Uint8Array | ArrayBuffer`
134
-
135
- A buffer representing file data. It works best if the buffer contains the entire file. It may work with a smaller portion as well.
136
-
137
- ### fileTypeFromFile(filePath, options)
138
-
139
- Detect the file type of a file path.
140
-
141
- This is for Node.js only.
142
-
143
- To read from a [`File`](https://developer.mozilla.org/docs/Web/API/File), see [`fileTypeFromBlob()`](#filetypefromblobblob-options).
144
-
145
- 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.
146
-
147
- Returns a `Promise` for an object with the detected file type:
148
-
149
- - `ext` - One of the [supported file types](#supported-file-types)
150
- - `mime` - The [MIME type](https://en.wikipedia.org/wiki/Internet_media_type)
151
-
152
- Or `undefined` when there is no match.
153
-
154
- #### filePath
155
-
156
- Type: `string`
157
-
158
- The file path to parse.
159
-
160
- ### fileTypeFromStream(stream)
161
-
162
- Detect the file type of a [web `ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream).
163
-
164
- If the engine is Node.js, this may also be a [Node.js `stream.Readable`](https://nodejs.org/api/stream.html#stream_class_stream_readable).
165
-
166
- Direct support for Node.js streams will be dropped in the future, when Node.js streams can be converted to Web streams (see [`toWeb()`](https://nodejs.org/api/stream.html#streamreadabletowebstreamreadable-options)).
167
-
168
- 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.
169
-
170
- Returns a `Promise` for an object with the detected file type:
171
-
172
- - `ext` - One of the [supported file types](#supported-file-types)
173
- - `mime` - The [MIME type](https://en.wikipedia.org/wiki/Internet_media_type)
174
-
175
- Or `undefined` when there is no match.
176
-
177
- #### stream
178
-
179
- Type: [Web `ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) or [Node.js `stream.Readable`](https://nodejs.org/api/stream.html#stream_class_stream_readable)
180
-
181
- A readable stream representing file data.
182
-
183
- ### fileTypeFromBlob(blob, options)
184
-
185
- Detect the file type of a [`Blob`](https://developer.mozilla.org/docs/Web/API/Blob),
186
-
187
- > [!TIP]
188
- > A [`File` object](https://developer.mozilla.org/docs/Web/API/File) is a `Blob` and can be passed in here.
189
-
190
- It will **stream** the underlying Blob.
191
-
192
- The file type is detected by checking the [magic number](https://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files) of the blob.
193
-
194
- Returns a `Promise` for an object with the detected file type:
195
-
196
- - `ext` - One of the [supported file types](#supported-file-types)
197
- - `mime` - The [MIME type](https://en.wikipedia.org/wiki/Internet_media_type)
198
-
199
- Or `undefined` when there is no match.
200
-
201
- ```js
202
- import {fileTypeFromBlob} from 'file-type';
203
-
204
- const blob = new Blob(['<?xml version="1.0" encoding="ISO-8859-1" ?>'], {
205
- type: 'text/plain',
206
- endings: 'native'
207
- });
208
-
209
- console.log(await fileTypeFromBlob(blob));
210
- //=> {ext: 'txt', mime: 'text/plain'}
211
- ```
212
-
213
- #### blob
214
-
215
- Type: [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob)
216
-
217
- ### fileTypeFromTokenizer(tokenizer, options)
218
-
219
- Detect the file type from an `ITokenizer` source.
220
-
221
- This method is used internally, but can also be used for a special "tokenizer" reader.
222
-
223
- A tokenizer propagates the internal read functions, allowing alternative transport mechanisms, to access files, to be implemented and used.
224
-
225
- Returns a `Promise` for an object with the detected file type:
226
-
227
- - `ext` - One of the [supported file types](#supported-file-types)
228
- - `mime` - The [MIME type](https://en.wikipedia.org/wiki/Internet_media_type)
229
-
230
- Or `undefined` when there is no match.
231
-
232
- 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 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.
233
-
234
- ```js
235
- import {makeTokenizer} from '@tokenizer/http';
236
- import {fileTypeFromTokenizer} from 'file-type';
237
-
238
- const 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';
239
-
240
- const httpTokenizer = await makeTokenizer(audioTrackUrl);
241
- const fileType = await fileTypeFromTokenizer(httpTokenizer);
242
-
243
- console.log(fileType);
244
- //=> {ext: 'mp3', mime: 'audio/mpeg'}
245
- ```
246
-
247
- Or 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):
248
-
249
- ```js
250
- import {S3Client} from '@aws-sdk/client-s3';
251
- import {makeChunkedTokenizerFromS3} from '@tokenizer/s3';
252
- import {fileTypeFromTokenizer} from 'file-type';
253
-
254
- // Initialize the S3 client
255
- // Initialize S3 client
256
- const s3 = new S3Client();
257
-
258
- // Initialize the S3 tokenizer.
259
- const s3Tokenizer = await makeChunkedTokenizerFromS3(s3, {
260
- Bucket: 'affectlab',
261
- Key: '1min_35sec.mp4'
262
- });
263
-
264
- // Figure out what kind of file it is.
265
- const fileType = await fileTypeFromTokenizer(s3Tokenizer);
266
- console.log(fileType);
267
- ```
268
-
269
- Note 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).
270
-
271
- #### tokenizer
272
-
273
- Type: [`ITokenizer`](https://github.com/Borewit/strtok3#tokenizer)
274
-
275
- A file source implementing the [tokenizer interface](https://github.com/Borewit/strtok3#tokenizer).
276
-
277
- ### fileTypeStream(webStream, options?)
278
-
279
- Returns 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 `fileTypeFromFile()`.
280
-
281
- This method can be handy to put in between a stream, but it comes with a price.
282
- Internally `stream()` builds up a buffer of `sampleSize` bytes, used as a sample, to determine the file type.
283
- The sample size impacts the file detection resolution.
284
- A smaller sample size will result in lower probability of the best file type detection.
285
-
286
- **Note:** When using Node.js, a `stream.Readable` may be provided as well.
287
-
288
- #### readableStream
289
-
290
- Type: [`stream.Readable`](https://nodejs.org/api/stream.html#stream_class_stream_readable)
291
-
292
- #### options
293
-
294
- Type: `object`
295
-
296
- Supports the following options in addition to the [general options](#options):
297
-
298
- ##### sampleSize
299
-
300
- Type: `number`\
301
- Default: `4100`
302
-
303
- The sample size in bytes.
304
-
305
- #### Example
306
-
307
- ```js
308
- import got from 'got';
309
- import {fileTypeStream} from 'file-type';
310
-
311
- const url = 'https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg';
312
-
313
- const stream1 = got.stream(url);
314
- const stream2 = await fileTypeStream(stream1, {sampleSize: 1024});
315
-
316
- if (stream2.fileType?.mime === 'image/jpeg') {
317
- // stream2 can be used to stream the JPEG image (from the very beginning of the stream)
318
- }
319
- ```
320
-
321
- #### readableStream
322
-
323
- Type: [`stream.Readable`](https://nodejs.org/api/stream.html#stream_class_stream_readable)
324
-
325
- The input stream.
326
-
327
- ### supportedExtensions
328
-
329
- Returns a `Set<string>` of supported file extensions.
330
-
331
- ### supportedMimeTypes
332
-
333
- Returns a `Set<string>` of supported MIME types.
334
-
335
- ### Options
336
-
337
- #### customDetectors
338
-
339
- Array of custom file type detectors to run before default detectors.
340
-
341
- For example:
342
-
343
- ```js
344
- import {fileTypeFromFile} from 'file-type';
345
- import {detectXml} from '@file-type/xml';
346
-
347
- const fileType = await fileTypeFromFile('sample.kml', {customDetectors: [detectXml]});
348
- console.log(fileType);
349
- ```
350
-
351
- #### mpegOffsetTolerance
352
-
353
- Default: `0`
354
-
355
- Specifies the byte tolerance for locating the first MPEG audio frame (e.g. `.mp1`, `.mp2`, `.mp3`, `.aac`).
356
-
357
- Allows detection to handle slight sync offsets between the expected and actual frame start. Common in malformed or incorrectly muxed files, which, while technically invalid, do occur in the wild.
358
-
359
- A tolerance of 10 bytes covers most cases.
360
-
361
- ## Custom detectors
362
-
363
- Custom file type detectors are plugins designed to extend the default detection capabilities.
364
- They allow support for uncommon file types, non-binary formats, or customized detection behavior.
365
-
366
- Detectors can be added via the constructor options or by modifying `FileTypeParser#detectors` directly.
367
- Detectors provided through the constructor are executed before the default ones.
368
-
369
- Detectors can be added via the constructor options or by directly modifying `FileTypeParser#detectors`.
370
-
371
- ### Example adding a detector
372
-
373
- For example:
374
-
375
- ```js
376
- import {FileTypeParser} from 'file-type';
377
- import {detectXml} from '@file-type/xml';
378
-
379
- const parser = new FileTypeParser({customDetectors: [detectXml]});
380
- const fileType = await parser.fromFile('sample.kml');
381
- console.log(fileType);
382
- ```
383
-
384
- ### Available third-party file-type detectors
385
-
386
- - [@file-type/av](https://github.com/Borewit/file-type-av): Improves detection of audio and video file formats, with accurate differentiation between the two
387
- - [@file-type/cfbf](https://github.com/Borewit/file-type-cfbf): Detects Compound File Binary Format (CFBF) based formats, such as Office 97–2003 documents and `.msi`.
388
- - [@file-type/pdf](https://github.com/Borewit/file-type-pdf): Detects PDF based file types, such as Adobe Illustrator
389
- - [@file-type/xml](https://github.com/Borewit/file-type-xml): Detects common XML file types, such as GLM, KML, MusicXML, RSS, SVG, and XHTML
390
-
391
- ### Detector execution flow
392
-
393
- If a detector returns `undefined`, the following rules apply:
394
-
395
- 1. **No Tokenizer Interaction**: If the detector does not modify the tokenizer's position, the next detector in the sequence is executed.
396
- 2. **Tokenizer Interaction**: If the detector modifies the tokenizer's position (`tokenizer.position` is advanced), no further detectors are executed. In this case, the file type remains `undefined`, as subsequent detectors cannot evaluate the content. This is an exceptional scenario, as it prevents any other detectors from determining the file type.
397
-
398
- ### Writing your own custom detector
399
-
400
- Below is an example of a custom detector array. This can be passed to the `FileTypeParser` via the `fileTypeOptions` argument.
401
-
402
- ```js
403
- import {FileTypeParser} from 'file-type';
404
-
405
- const unicornDetector = {
406
- id: 'unicorn', // May be used to recognize the detector in the detector list
407
- async detect(tokenizer) {
408
- const unicornHeader = [85, 78, 73, 67, 79, 82, 78]; // "UNICORN" in ASCII decimal
409
-
410
- const buffer = new Uint8Array(unicornHeader.length);
411
- await tokenizer.peekBuffer(buffer, {length: unicornHeader.length, mayBeLess: true});
412
- if (unicornHeader.every((value, index) => value === buffer[index])) {
413
- return {ext: 'unicorn', mime: 'application/unicorn'};
414
- }
415
-
416
- return undefined;
417
- }
418
- }
419
-
420
- const buffer = new Uint8Array([85, 78, 73, 67, 79, 82, 78]);
421
- const parser = new FileTypeParser({customDetectors: [unicornDetector]});
422
- const fileType = await parser.fromBuffer(buffer);
423
- console.log(fileType); // {ext: 'unicorn', mime: 'application/unicorn'}
424
- ```
425
-
426
- ```ts
427
- /**
428
- @param tokenizer - The [tokenizer](https://github.com/Borewit/strtok3#tokenizer) used to read file content.
429
- @param fileType - The file type detected by standard or previous custom detectors, or `undefined` if no match is found.
430
- @returns The detected file type, or `undefined` if no match is found.
431
- */
432
- export type Detector = (tokenizer: ITokenizer, fileType?: FileTypeResult) => Promise<FileTypeResult | undefined>;
433
- ```
434
-
435
- ## Abort signal
436
-
437
- Some async operations can be aborted by passing an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) to the `FileTypeParser` constructor.
438
-
439
- ```js
440
- import {FileTypeParser} from 'file-type';
441
-
442
- const abortController = new AbortController()
443
-
444
- const parser = new FileTypeParser({signal: abortController.signal});
445
-
446
- const promise = parser.fromStream(blob.stream());
447
-
448
- abortController.abort(); // Abort file-type reading from the Blob stream.
449
- ```
450
-
451
- ## Supported file types
452
-
453
- - [`3g2`](https://en.wikipedia.org/wiki/3GP_and_3G2#3G2) - Multimedia container format defined by the 3GPP2 for 3G CDMA2000 multimedia services
454
- - [`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
455
- - [`3mf`](https://en.wikipedia.org/wiki/3D_Manufacturing_Format) - 3D Manufacturing Format
456
- - [`7z`](https://en.wikipedia.org/wiki/7z) - 7-Zip archive
457
- - [`Z`](https://fileinfo.com/extension/z) - Unix Compressed File
458
- - [`aac`](https://en.wikipedia.org/wiki/Advanced_Audio_Coding) - Advanced Audio Coding
459
- - [`ac3`](https://www.atsc.org/standard/a522012-digital-audio-compression-ac-3-e-ac-3-standard-12172012/) - ATSC A/52 Audio File
460
- - [`ace`](https://en.wikipedia.org/wiki/ACE_(compressed_file_format)) - ACE archive
461
- - [`aif`](https://en.wikipedia.org/wiki/Audio_Interchange_File_Format) - Audio Interchange file
462
- - [`alias`](https://en.wikipedia.org/wiki/Alias_%28Mac_OS%29) - macOS Alias file
463
- - [`amr`](https://en.wikipedia.org/wiki/Adaptive_Multi-Rate_audio_codec) - Adaptive Multi-Rate audio codec
464
- - [`ape`](https://en.wikipedia.org/wiki/Monkey%27s_Audio) - Monkey's Audio
465
- - [`apk`](https://en.wikipedia.org/wiki/Apk_(file_format)) - Android package format
466
- - [`apng`](https://en.wikipedia.org/wiki/APNG) - Animated Portable Network Graphics
467
- - [`ar`](https://en.wikipedia.org/wiki/Ar_(Unix)) - Archive file
468
- - [`arj`](https://en.wikipedia.org/wiki/ARJ) - Archive file
469
- - [`arrow`](https://arrow.apache.org) - Columnar format for tables of data
470
- - [`arw`](https://en.wikipedia.org/wiki/Raw_image_format#ARW) - Sony Alpha Raw image file
471
- - [`asar`](https://github.com/electron/asar#format) - Archive format primarily used to enclose Electron applications
472
- - [`asf`](https://en.wikipedia.org/wiki/Advanced_Systems_Format) - Advanced Systems Format
473
- - [`avi`](https://en.wikipedia.org/wiki/Audio_Video_Interleave) - Audio Video Interleave file
474
- - [`avif`](https://en.wikipedia.org/wiki/AV1#AV1_Image_File_Format_(AVIF)) - AV1 Image File Format
475
- - [`avro`](https://en.wikipedia.org/wiki/Apache_Avro#Avro_Object_Container_File) - Object container file developed by Apache Avro
476
- - [`blend`](https://wiki.blender.org/index.php/Dev:Source/Architecture/File_Format) - Blender project
477
- - [`bmp`](https://en.wikipedia.org/wiki/BMP_file_format) - Bitmap image file
478
- - [`bpg`](https://bellard.org/bpg/) - Better Portable Graphics file
479
- - [`bz2`](https://en.wikipedia.org/wiki/Bzip2) - Archive file
480
- - [`cab`](https://en.wikipedia.org/wiki/Cabinet_(file_format)) - Cabinet file
481
- - [`cfb`](https://en.wikipedia.org/wiki/Compound_File_Binary_Format) - Compound File Binary Format
482
- - [`chm`](https://en.wikipedia.org/wiki/Microsoft_Compiled_HTML_Help) - Microsoft Compiled HTML Help
483
- - [`class`](https://en.wikipedia.org/wiki/Java_class_file) - Java class file
484
- - [`cpio`](https://en.wikipedia.org/wiki/Cpio) - Cpio archive
485
- - [`cr2`](https://fileinfo.com/extension/cr2) - Canon Raw image file (v2)
486
- - [`cr3`](https://fileinfo.com/extension/cr3) - Canon Raw image file (v3)
487
- - [`crx`](https://developer.chrome.com/extensions/crx) - Google Chrome extension
488
- - [`cur`](https://en.wikipedia.org/wiki/ICO_(file_format)) - Icon file
489
- - [`dat`](https://en.wikipedia.org/wiki/Windows_Registry) - Windows registry hive file
490
- - [`dcm`](https://en.wikipedia.org/wiki/DICOM#Data_format) - DICOM Image File
491
- - [`deb`](https://en.wikipedia.org/wiki/Deb_(file_format)) - Debian package
492
- - [`dmg`](https://en.wikipedia.org/wiki/Apple_Disk_Image) - Apple Disk Image
493
- - [`dng`](https://en.wikipedia.org/wiki/Digital_Negative) - Adobe Digital Negative image file
494
- - [`docm`](https://en.wikipedia.org/wiki/List_of_Microsoft_Office_filename_extensions) - Microsoft Word macro-enabled document
495
- - [`docx`](https://en.wikipedia.org/wiki/Office_Open_XML) - Microsoft Word document
496
- - [`dotm`](https://en.wikipedia.org/wiki/List_of_Microsoft_Office_filename_extensions) - Microsoft Word macro-enabled template
497
- - [`dotx`](https://en.wikipedia.org/wiki/List_of_Microsoft_Office_filename_extensions) - Microsoft Word template
498
- - [`drc`](https://en.wikipedia.org/wiki/Zstandard) - Google's Draco 3D Data Compression
499
- - [`dsf`](https://dsd-guide.com/sites/default/files/white-papers/DSFFileFormatSpec_E.pdf) - Sony DSD Stream File (DSF)
500
- - [`dwg`](https://en.wikipedia.org/wiki/.dwg) - Autodesk CAD file
501
- - [`elf`](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format) - Unix Executable and Linkable Format
502
- - [`eot`](https://en.wikipedia.org/wiki/Embedded_OpenType) - Embedded OpenType font
503
- - [`eps`](https://en.wikipedia.org/wiki/Encapsulated_PostScript) - Encapsulated PostScript
504
- - [`epub`](https://en.wikipedia.org/wiki/EPUB) - E-book file
505
- - [`exe`](https://en.wikipedia.org/wiki/.exe) - Executable file
506
- - [`f4a`](https://en.wikipedia.org/wiki/Flash_Video) - Audio-only ISO base media file format used by Adobe Flash Player
507
- - [`f4b`](https://en.wikipedia.org/wiki/Flash_Video) - Audiobook and podcast ISO base media file format used by Adobe Flash Player
508
- - [`f4p`](https://en.wikipedia.org/wiki/Flash_Video) - ISO base media file format protected by Adobe Access DRM used by Adobe Flash Player
509
- - [`f4v`](https://en.wikipedia.org/wiki/Flash_Video) - ISO base media file format used by Adobe Flash Player
510
- - [`fbx`](https://en.wikipedia.org/wiki/FBX) - Filmbox is a proprietary file format used to provide interoperability between digital content creation apps.
511
- - [`flac`](https://en.wikipedia.org/wiki/FLAC) - Free Lossless Audio Codec
512
- - [`flif`](https://en.wikipedia.org/wiki/Free_Lossless_Image_Format) - Free Lossless Image Format
513
- - [`flv`](https://en.wikipedia.org/wiki/Flash_Video) - Flash video
514
- - [`gif`](https://en.wikipedia.org/wiki/GIF) - Graphics Interchange Format
515
- - [`glb`](https://github.com/KhronosGroup/glTF) - GL Transmission Format
516
- - [`gz`](https://en.wikipedia.org/wiki/Gzip) - Archive file
517
- - [`heic`](https://nokiatech.github.io/heif/technical.html) - High Efficiency Image File Format
518
- - [`icc`](https://en.wikipedia.org/wiki/ICC_profile) - ICC Profile
519
- - [`icns`](https://en.wikipedia.org/wiki/Apple_Icon_Image_format) - Apple Icon image
520
- - [`ico`](https://en.wikipedia.org/wiki/ICO_(file_format)) - Windows icon file
521
- - [`ics`](https://en.wikipedia.org/wiki/ICalendar#Data_format) - iCalendar
522
- - [`indd`](https://en.wikipedia.org/wiki/Adobe_InDesign#File_format) - Adobe InDesign document
523
- - [`it`](https://wiki.openmpt.org/Manual:_Module_formats#The_Impulse_Tracker_format_.28.it.29) - Audio module format: Impulse Tracker
524
- - [`j2c`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
525
- - [`jar`](https://en.wikipedia.org/wiki/JAR_(file_format)) - Java archive
526
- - [`jls`](https://en.wikipedia.org/wiki/Lossless_JPEG#JPEG-LS) - Lossless/near-lossless compression standard for continuous-tone images
527
- - [`jmp`](https://en.wikipedia.org/wiki/JMP_(statistical_software)) - JMP data file format by SAS Institute
528
- - [`jp2`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
529
- - [`jpg`](https://en.wikipedia.org/wiki/JPEG) - Joint Photographic Experts Group image
530
- - [`jpm`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
531
- - [`jpx`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
532
- - [`jxl`](https://en.wikipedia.org/wiki/JPEG_XL) - JPEG XL image format
533
- - [`jxr`](https://en.wikipedia.org/wiki/JPEG_XR) - Joint Photographic Experts Group extended range
534
- - [`ktx`](https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/) - OpenGL and OpenGL ES textures
535
- - [`lnk`](https://en.wikipedia.org/wiki/Shortcut_%28computing%29#Microsoft_Windows) - Microsoft Windows file shortcut
536
- - [`lz`](https://en.wikipedia.org/wiki/Lzip) - Archive file
537
- - [`lz4`](https://en.wikipedia.org/wiki/LZ4_(compression_algorithm)) - Compressed archive created by one of a variety of LZ4 compression utilities
538
- - [`lzh`](https://en.wikipedia.org/wiki/LHA_(file_format)) - LZH archive
539
- - [`m4a`](https://en.wikipedia.org/wiki/M4A) - Audio-only MPEG-4 files
540
- - [`m4b`](https://en.wikipedia.org/wiki/M4B) - Audiobook and podcast MPEG-4 files, which also contain metadata including chapter markers, images, and hyperlinks
541
- - [`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
542
- - [`m4v`](https://en.wikipedia.org/wiki/M4V) - Video container format developed by Apple, which is very similar to the MP4 format
543
- - [`macho`](https://en.wikipedia.org/wiki/Mach-O) - Mach-O binary format
544
- - [`mid`](https://en.wikipedia.org/wiki/MIDI) - Musical Instrument Digital Interface file
545
- - [`mie`](https://en.wikipedia.org/wiki/Sidecar_file) - Dedicated meta information format which supports storage of binary as well as textual meta information
546
- - [`mj2`](https://en.wikipedia.org/wiki/Motion_JPEG_2000) - Motion JPEG 2000
547
- - [`mkv`](https://en.wikipedia.org/wiki/Matroska) - Matroska video file
548
- - [`mobi`](https://en.wikipedia.org/wiki/Mobipocket) - Mobipocket
549
- - [`mov`](https://en.wikipedia.org/wiki/QuickTime_File_Format) - QuickTime video file
550
- - [`mp1`](https://en.wikipedia.org/wiki/MPEG-1_Audio_Layer_I) - MPEG-1 Audio Layer I
551
- - [`mp2`](https://en.wikipedia.org/wiki/MPEG-1_Audio_Layer_II) - MPEG-1 Audio Layer II
552
- - [`mp3`](https://en.wikipedia.org/wiki/MP3) - Audio file
553
- - [`mp4`](https://en.wikipedia.org/wiki/MPEG-4_Part_14#Filename_extensions) - MPEG-4 Part 14 video file
554
- - [`mpc`](https://en.wikipedia.org/wiki/Musepack) - Musepack (SV7 & SV8)
555
- - [`mpg`](https://en.wikipedia.org/wiki/MPEG-1) - MPEG-1 file
556
- - [`mts`](https://en.wikipedia.org/wiki/.m2ts) - MPEG-2 Transport Stream, both raw and Blu-ray Disc Audio-Video (BDAV) versions
557
- - [`mxf`](https://en.wikipedia.org/wiki/Material_Exchange_Format) - Material Exchange Format
558
- - [`nef`](https://www.nikonusa.com/en/learn-and-explore/a/products-and-innovation/nikon-electronic-format-nef.html) - Nikon Electronic Format image file
559
- - [`nes`](https://fileinfo.com/extension/nes) - Nintendo NES ROM
560
- - [`odg`](https://en.wikipedia.org/wiki/OpenDocument) - OpenDocument for drawing
561
- - [`odp`](https://en.wikipedia.org/wiki/OpenDocument) - OpenDocument for presentations
562
- - [`ods`](https://en.wikipedia.org/wiki/OpenDocument) - OpenDocument for spreadsheets
563
- - [`odt`](https://en.wikipedia.org/wiki/OpenDocument) - OpenDocument for word processing
564
- - [`oga`](https://en.wikipedia.org/wiki/Ogg) - Audio file
565
- - [`ogg`](https://en.wikipedia.org/wiki/Ogg) - Audio file
566
- - [`ogm`](https://en.wikipedia.org/wiki/Ogg) - Audio file
567
- - [`ogv`](https://en.wikipedia.org/wiki/Ogg) - Audio file
568
- - [`ogx`](https://en.wikipedia.org/wiki/Ogg) - Audio file
569
- - [`opus`](https://en.wikipedia.org/wiki/Opus_(audio_format)) - Audio file
570
- - [`orf`](https://en.wikipedia.org/wiki/ORF_format) - Olympus Raw image file
571
- - [`otf`](https://en.wikipedia.org/wiki/OpenType) - OpenType font
572
- - [`otg`](https://en.wikipedia.org/wiki/OpenDocument_technical_specification#Templates) - OpenDocument template for drawing
573
- - [`otp`](https://en.wikipedia.org/wiki/OpenDocument_technical_specification#Templates) - OpenDocument template for presentations
574
- - [`ots`](https://en.wikipedia.org/wiki/OpenDocument_technical_specification#Templates) - OpenDocument template for spreadsheets
575
- - [`ott`](https://en.wikipedia.org/wiki/OpenDocument_technical_specification#Templates) - OpenDocument template for word processing
576
- - [`parquet`](https://en.wikipedia.org/wiki/Apache_Parquet) - Apache Parquet
577
- - [`pcap`](https://wiki.wireshark.org/Development/LibpcapFileFormat) - Libpcap File Format
578
- - [`pdf`](https://en.wikipedia.org/wiki/Portable_Document_Format) - Portable Document Format
579
- - [`pgp`](https://en.wikipedia.org/wiki/Pretty_Good_Privacy) - Pretty Good Privacy
580
- - [`png`](https://en.wikipedia.org/wiki/Portable_Network_Graphics) - Portable Network Graphics
581
- - [`potm`](https://en.wikipedia.org/wiki/List_of_Microsoft_Office_filename_extensions) - Microsoft PowerPoint macro-enabled template
582
- - [`potx`](https://en.wikipedia.org/wiki/List_of_Microsoft_Office_filename_extensions) - Microsoft PowerPoint template
583
- - [`ppsm`](https://en.wikipedia.org/wiki/List_of_Microsoft_Office_filename_extensions#PowerPoint) - Office PowerPoint 2007 macro-enabled slide show
584
- - [`ppsx`](https://en.wikipedia.org/wiki/List_of_Microsoft_Office_filename_extensions#PowerPoint) - Office PowerPoint 2007 slide show
585
- - [`pptm`](https://en.wikipedia.org/wiki/List_of_Microsoft_Office_filename_extensions) - Microsoft PowerPoint macro-enabled document
586
- - [`pptx`](https://en.wikipedia.org/wiki/Office_Open_XML) - Microsoft PowerPoint document
587
- - [`ps`](https://en.wikipedia.org/wiki/Postscript) - Postscript
588
- - [`psd`](https://en.wikipedia.org/wiki/Adobe_Photoshop#File_format) - Adobe Photoshop document
589
- - [`pst`](https://en.wikipedia.org/wiki/Personal_Storage_Table) - Personal Storage Table file
590
- - [`qcp`](https://en.wikipedia.org/wiki/QCP) - Tagged and chunked data
591
- - [`raf`](https://en.wikipedia.org/wiki/Raw_image_format) - Fujifilm RAW image file
592
- - [`rar`](https://en.wikipedia.org/wiki/RAR_(file_format)) - Archive file
593
- - [`reg`](https://en.wikipedia.org/wiki/Windows_Registry) - Windows registry (entries) file format
594
- - [`rm`](https://en.wikipedia.org/wiki/RealMedia) - RealMedia
595
- - [`rpm`](https://fileinfo.com/extension/rpm) - Red Hat Package Manager file
596
- - [`rtf`](https://en.wikipedia.org/wiki/Rich_Text_Format) - Rich Text Format
597
- - [`rw2`](https://en.wikipedia.org/wiki/Raw_image_format) - Panasonic RAW image file
598
- - [`s3m`](https://wiki.openmpt.org/Manual:_Module_formats#The_ScreamTracker_3_format_.28.s3m.29) - Audio module format: ScreamTracker 3
599
- - [`sav`](https://en.wikipedia.org/wiki/SPSS) - SPSS Statistical Data File
600
- - [`shp`](https://en.wikipedia.org/wiki/Shapefile) - Geospatial vector data format
601
- - [`skp`](https://en.wikipedia.org/wiki/SketchUp) - SketchUp
602
- - [`spx`](https://en.wikipedia.org/wiki/Ogg) - Audio file
603
- - [`sqlite`](https://www.sqlite.org/fileformat2.html) - SQLite file
604
- - [`stl`](https://en.wikipedia.org/wiki/STL_(file_format)) - Standard Tesselated Geometry File Format (ASCII only)
605
- - [`swf`](https://en.wikipedia.org/wiki/SWF) - Adobe Flash Player file
606
- - [`tar`](https://en.wikipedia.org/wiki/Tar_(computing)#File_format) - Tape archive or tarball
607
- - [`tar.gz`](https://en.wikipedia.org/wiki/Gzip) - Gzipped tape archive (tarball)
608
- - [`tif`](https://en.wikipedia.org/wiki/Tagged_Image_File_Format) - Tagged Image file
609
- - [`ttc`](https://en.wikipedia.org/wiki/TrueType#TrueType_Collection) - TrueType Collection font
610
- - [`ttf`](https://en.wikipedia.org/wiki/TrueType) - TrueType font
611
- - [`vcf`](https://en.wikipedia.org/wiki/VCard) - vCard
612
- - [`voc`](https://wiki.multimedia.cx/index.php/Creative_Voice) - Creative Voice File
613
- - [`vsdx`](https://en.wikipedia.org/wiki/Microsoft_Visio) - Microsoft Visio File
614
- - [`vtt`](https://en.wikipedia.org/wiki/WebVTT) - WebVTT File (for video captions)
615
- - [`wasm`](https://en.wikipedia.org/wiki/WebAssembly) - WebAssembly intermediate compiled format
616
- - [`wav`](https://en.wikipedia.org/wiki/WAV) - Waveform Audio file
617
- - [`webm`](https://en.wikipedia.org/wiki/WebM) - Web video file
618
- - [`webp`](https://en.wikipedia.org/wiki/WebP) - Web Picture format
619
- - [`woff`](https://en.wikipedia.org/wiki/Web_Open_Font_Format) - Web Open Font Format
620
- - [`woff2`](https://en.wikipedia.org/wiki/Web_Open_Font_Format) - Web Open Font Format
621
- - [`wv`](https://en.wikipedia.org/wiki/WavPack) - WavPack
622
- - [`xcf`](https://en.wikipedia.org/wiki/XCF_(file_format)) - eXperimental Computing Facility
623
- - [`xlsm`](https://en.wikipedia.org/wiki/List_of_Microsoft_Office_filename_extensions) - Microsoft Excel macro-enabled document
624
- - [`xlsx`](https://en.wikipedia.org/wiki/Office_Open_XML) - Microsoft Excel document
625
- - [`xltm`](https://en.wikipedia.org/wiki/List_of_Microsoft_Office_filename_extensions) - Microsoft Excel macro-enabled template
626
- - [`xltx`](https://en.wikipedia.org/wiki/List_of_Microsoft_Office_filename_extensions) - Microsoft Excel template
627
- - [`xm`](https://wiki.openmpt.org/Manual:_Module_formats#The_FastTracker_2_format_.28.xm.29) - Audio module format: FastTracker 2
628
- - [`xml`](https://en.wikipedia.org/wiki/XML) - eXtensible Markup Language
629
- - [`xpi`](https://en.wikipedia.org/wiki/XPInstall) - XPInstall file
630
- - [`xz`](https://en.wikipedia.org/wiki/Xz) - Compressed file
631
- - [`zip`](https://en.wikipedia.org/wiki/Zip_(file_format)) - Archive file
632
- - [`zst`](https://en.wikipedia.org/wiki/Zstandard) - Archive file
633
-
634
- *[Pull requests](.github/pull_request_template.md) are welcome for additional commonly used file types.*
635
-
636
- The following file types will not be accepted, but most of them are supported by [third-party detector](#available-third-party-file-type-detectors)
637
- - [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)
638
- - `.doc` - Microsoft Word 97-2003 Document
639
- - `.xls` - Microsoft Excel 97-2003 Document
640
- - `.ppt` - Microsoft PowerPoint97-2003 Document
641
- - `.msi` - Microsoft Windows Installer
642
- - `.csv` - [Reason.](https://github.com/sindresorhus/file-type/issues/264#issuecomment-568439196)
643
- - `.svg`
644
-
645
- #### tokenizer
646
-
647
- Type: [`ITokenizer`](https://github.com/Borewit/strtok3#tokenizer)
648
-
649
- Usable as source of the examined file.
650
-
651
- #### fileType
652
-
653
- Type: `FileTypeResult`
654
-
655
- An object having an `ext` (extension) and `mime` (mime type) property.
656
-
657
- Detected by the standard detections or a previous custom detection. Undefined if no matching fileTypeResult could be found.
658
-
659
- ## Related
660
-
661
- - [file-type-cli](https://github.com/sindresorhus/file-type-cli) - CLI for this module
662
- - [image-dimensions](https://github.com/sindresorhus/image-dimensions) - Get the dimensions of an image
663
-
664
- ## Maintainers
665
-
666
- - [Sindre Sorhus](https://github.com/sindresorhus)
667
- - [Borewit](https://github.com/Borewit)