mime-bytes 0.0.2 → 0.1.1
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/README.md +9 -9
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
|
|
15
15
|
**Lightning-fast file type detection using magic bytes (file signatures) with a focus on stream processing and minimal memory usage.**
|
|
16
16
|
|
|
17
|
-
[Features](
|
|
17
|
+
[Features](#features) • [Installation](#installation) • [Quick Start](#quick-start) • [API](#api) • [File Types](#supported-file-types) • [Performance](#performance)
|
|
18
18
|
|
|
19
19
|
</div>
|
|
20
20
|
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## Features
|
|
24
24
|
|
|
25
25
|
- 🚀 **Stream-based detection** - Process files of any size without loading them into memory
|
|
26
26
|
- 📦 **100+ file types** - Comprehensive coverage of common and specialized formats
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
- 🌐 **Charset detection** - Automatic encoding detection for text files
|
|
34
34
|
- 🛡️ **Robust error handling** - Graceful degradation for unknown formats
|
|
35
35
|
|
|
36
|
-
##
|
|
36
|
+
## Installation
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
39
|
npm install mime-bytes
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
##
|
|
42
|
+
## Quick Start
|
|
43
43
|
|
|
44
44
|
```typescript
|
|
45
45
|
import { FileTypeDetector } from 'mime-bytes';
|
|
@@ -63,7 +63,7 @@ console.log(fileType);
|
|
|
63
63
|
// }
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
##
|
|
66
|
+
## API
|
|
67
67
|
|
|
68
68
|
### FileTypeDetector
|
|
69
69
|
|
|
@@ -200,7 +200,7 @@ interface FileTypeResult {
|
|
|
200
200
|
}
|
|
201
201
|
```
|
|
202
202
|
|
|
203
|
-
##
|
|
203
|
+
## Supported File Types
|
|
204
204
|
|
|
205
205
|
### Images (30+ formats)
|
|
206
206
|
- **Common**: PNG, JPEG, GIF, WebP, SVG, ICO
|
|
@@ -242,7 +242,7 @@ interface FileTypeResult {
|
|
|
242
242
|
- **Database**: SQLite
|
|
243
243
|
- **Disk Images**: ISO, DMG
|
|
244
244
|
|
|
245
|
-
##
|
|
245
|
+
## Performance
|
|
246
246
|
|
|
247
247
|
mime-bytes is designed for speed and efficiency:
|
|
248
248
|
|
|
@@ -323,7 +323,7 @@ async function detectMultipleFiles(files: string[]) {
|
|
|
323
323
|
}
|
|
324
324
|
```
|
|
325
325
|
|
|
326
|
-
##
|
|
326
|
+
## Error Handling
|
|
327
327
|
|
|
328
328
|
```typescript
|
|
329
329
|
try {
|
|
@@ -341,7 +341,7 @@ try {
|
|
|
341
341
|
}
|
|
342
342
|
```
|
|
343
343
|
|
|
344
|
-
##
|
|
344
|
+
## Contributing
|
|
345
345
|
|
|
346
346
|
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
|
|
347
347
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mime-bytes",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "Lightning-fast file type detection using magic bytes (file signatures) with a focus on stream processing and minimal memory usage",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"module": "esm/index.js",
|
|
8
8
|
"types": "index.d.ts",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"@types/glob": "^8.1.0",
|
|
35
35
|
"glob": "^11.0.2"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "52ec8086bb7da9908e858d8b89e9766a61d4365f"
|
|
38
38
|
}
|