@d0paminedriven/fs 7.3.0 → 7.5.0
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 +28 -5
- package/dist/{chunk-2XQ44ZWR.js → chunk-3MPIZJSN.js} +318 -72
- package/dist/{chunk-R63XI7FS.js → chunk-4DZLRFGH.js} +1 -1
- package/dist/{chunk-NHYRCNMW.js → chunk-6UANVLO3.js} +2 -2
- package/dist/{chunk-2IRCHZCF.js → chunk-CJBGTYSB.js} +3 -3
- package/dist/{chunk-LQP2FYMK.js → chunk-DSH3OL5Q.js} +5 -2
- package/dist/{chunk-NOOFSAF4.js → chunk-F57L5MBU.js} +3 -3
- package/dist/{chunk-KOKPGEU4.js → chunk-HQ2FHXLJ.js} +2 -2
- package/dist/{chunk-HPM4IQQR.js → chunk-LYQ3KQSL.js} +18 -10
- package/dist/{chunk-PTXZQBLV.js → chunk-N33N54TN.js} +2 -2
- package/dist/fs/index.d.ts +18 -83
- package/dist/fs/index.js +9 -9
- package/dist/fs-atomic/index.js +3 -3
- package/dist/fs-base/index.d.ts +1 -1
- package/dist/fs-base/index.js +2 -2
- package/dist/fs-core/index.js +6 -6
- package/dist/fs-fetch/index.d.ts +2 -2
- package/dist/fs-fetch/index.js +8 -8
- package/dist/fs-size/index.js +5 -5
- package/dist/fs-tmp/index.js +7 -7
- package/dist/image/index.d.ts +190 -14
- package/dist/image/index.js +1 -1
- package/dist/index.js +9 -9
- package/dist/mime/index.d.ts +2 -2
- package/dist/types/index.d.ts +3 -2
- package/dist/types/index.js +1 -1
- package/dist/types/stream.d.ts +2 -1
- package/package.json +4 -3
package/dist/image/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Readable } from 'node:stream';
|
|
1
2
|
import { ImageSpecs } from '../types/index.js';
|
|
2
3
|
import { MimeService } from '../mime/index.js';
|
|
3
|
-
import { Readable } from 'node:stream';
|
|
4
4
|
import 'stream';
|
|
5
5
|
import 'buffer';
|
|
6
6
|
import '../url/index.js';
|
|
@@ -14,16 +14,16 @@ declare class ImageService extends MimeService {
|
|
|
14
14
|
* Read exactly N bytes from a stream, returning a Buffer
|
|
15
15
|
* Closes stream after reading or on error
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
readBytes(stream: Readable, bytes: number): Promise<Buffer>;
|
|
18
18
|
/**
|
|
19
19
|
* Extract image metadata from a stream, reading only ~4KB for most formats
|
|
20
20
|
* Automatically handles PNG, JPEG, GIF, BMP, WebP, and AVIF
|
|
21
21
|
*/
|
|
22
|
-
extractFromStream(stream: Readable): Promise<ImageSpecs>;
|
|
22
|
+
extractFromStream(stream: Readable, size?: number): Promise<ImageSpecs>;
|
|
23
23
|
/**
|
|
24
24
|
* Extract metadata from file path using streaming (memory efficient)
|
|
25
25
|
*/
|
|
26
|
-
extractFromPath(filePath: string): Promise<ImageSpecs>;
|
|
26
|
+
extractFromPath(filePath: string, size?: number): Promise<ImageSpecs>;
|
|
27
27
|
private isPNG;
|
|
28
28
|
private isJPEG;
|
|
29
29
|
private isGIF;
|
|
@@ -40,20 +40,191 @@ declare class ImageService extends MimeService {
|
|
|
40
40
|
private parseXmpFromAvif;
|
|
41
41
|
private readVarSize;
|
|
42
42
|
private findBox;
|
|
43
|
+
private mapChrmToColorSpace;
|
|
44
|
+
private xmpToColorSpaceWorkup;
|
|
45
|
+
private mapXmpToColorSpace;
|
|
46
|
+
private mapProfileToColorSpace;
|
|
47
|
+
extractViaStream(stream: Readable, size?: number): Promise<{
|
|
48
|
+
width: number;
|
|
49
|
+
height: number;
|
|
50
|
+
format: "apng" | "png";
|
|
51
|
+
frames: number;
|
|
52
|
+
animated: boolean;
|
|
53
|
+
hasAlpha: boolean;
|
|
54
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed";
|
|
55
|
+
orientation: null;
|
|
56
|
+
aspectRatio: number;
|
|
57
|
+
colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
|
|
58
|
+
iccProfile: string | null;
|
|
59
|
+
exifDateTimeOriginal: string | null;
|
|
60
|
+
} | {
|
|
61
|
+
width: number;
|
|
62
|
+
height: number;
|
|
63
|
+
format: "jpeg";
|
|
64
|
+
frames: number;
|
|
65
|
+
animated: false;
|
|
66
|
+
hasAlpha: false;
|
|
67
|
+
orientation: number | null;
|
|
68
|
+
aspectRatio: number;
|
|
69
|
+
colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
|
|
70
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck";
|
|
71
|
+
iccProfile: string | null;
|
|
72
|
+
exifDateTimeOriginal: string | null;
|
|
73
|
+
} | {
|
|
74
|
+
width: number;
|
|
75
|
+
height: number;
|
|
76
|
+
format: "gif";
|
|
77
|
+
frames: number;
|
|
78
|
+
animated: boolean;
|
|
79
|
+
hasAlpha: null;
|
|
80
|
+
orientation: null;
|
|
81
|
+
aspectRatio: number;
|
|
82
|
+
colorModel: "indexed";
|
|
83
|
+
colorSpace: "unknown";
|
|
84
|
+
iccProfile: null;
|
|
85
|
+
exifDateTimeOriginal: null;
|
|
86
|
+
} | {
|
|
87
|
+
width: number;
|
|
88
|
+
height: number;
|
|
89
|
+
format: "bmp";
|
|
90
|
+
frames: number;
|
|
91
|
+
animated: false;
|
|
92
|
+
hasAlpha: null;
|
|
93
|
+
orientation: number;
|
|
94
|
+
aspectRatio: number;
|
|
95
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck";
|
|
96
|
+
colorSpace: "unknown";
|
|
97
|
+
iccProfile: null;
|
|
98
|
+
exifDateTimeOriginal: null;
|
|
99
|
+
} | {
|
|
100
|
+
width: number;
|
|
101
|
+
height: number;
|
|
102
|
+
format: "webp";
|
|
103
|
+
frames: number;
|
|
104
|
+
animated: boolean;
|
|
105
|
+
hasAlpha: boolean;
|
|
106
|
+
colorModel: "unknown" | "rgb" | "rgba";
|
|
107
|
+
orientation: null;
|
|
108
|
+
aspectRatio: number;
|
|
109
|
+
colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
|
|
110
|
+
iccProfile: string | null;
|
|
111
|
+
exifDateTimeOriginal: null;
|
|
112
|
+
} | {
|
|
113
|
+
width: number;
|
|
114
|
+
height: number;
|
|
115
|
+
format: "avif";
|
|
116
|
+
frames: number;
|
|
117
|
+
animated: boolean;
|
|
118
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck";
|
|
119
|
+
hasAlpha: true | null;
|
|
120
|
+
orientation: null;
|
|
121
|
+
aspectRatio: number;
|
|
122
|
+
colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
|
|
123
|
+
iccProfile: string | null;
|
|
124
|
+
exifDateTimeOriginal: string | null;
|
|
125
|
+
}>;
|
|
126
|
+
extractViaPath(filePath: string, size?: number): Promise<{
|
|
127
|
+
width: number;
|
|
128
|
+
height: number;
|
|
129
|
+
format: "apng" | "png";
|
|
130
|
+
frames: number;
|
|
131
|
+
animated: boolean;
|
|
132
|
+
hasAlpha: boolean;
|
|
133
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed";
|
|
134
|
+
orientation: null;
|
|
135
|
+
aspectRatio: number;
|
|
136
|
+
colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
|
|
137
|
+
iccProfile: string | null;
|
|
138
|
+
exifDateTimeOriginal: string | null;
|
|
139
|
+
} | {
|
|
140
|
+
width: number;
|
|
141
|
+
height: number;
|
|
142
|
+
format: "jpeg";
|
|
143
|
+
frames: number;
|
|
144
|
+
animated: false;
|
|
145
|
+
hasAlpha: false;
|
|
146
|
+
orientation: number | null;
|
|
147
|
+
aspectRatio: number;
|
|
148
|
+
colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
|
|
149
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck";
|
|
150
|
+
iccProfile: string | null;
|
|
151
|
+
exifDateTimeOriginal: string | null;
|
|
152
|
+
} | {
|
|
153
|
+
width: number;
|
|
154
|
+
height: number;
|
|
155
|
+
format: "gif";
|
|
156
|
+
frames: number;
|
|
157
|
+
animated: boolean;
|
|
158
|
+
hasAlpha: null;
|
|
159
|
+
orientation: null;
|
|
160
|
+
aspectRatio: number;
|
|
161
|
+
colorModel: "indexed";
|
|
162
|
+
colorSpace: "unknown";
|
|
163
|
+
iccProfile: null;
|
|
164
|
+
exifDateTimeOriginal: null;
|
|
165
|
+
} | {
|
|
166
|
+
width: number;
|
|
167
|
+
height: number;
|
|
168
|
+
format: "bmp";
|
|
169
|
+
frames: number;
|
|
170
|
+
animated: false;
|
|
171
|
+
hasAlpha: null;
|
|
172
|
+
orientation: number;
|
|
173
|
+
aspectRatio: number;
|
|
174
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck";
|
|
175
|
+
colorSpace: "unknown";
|
|
176
|
+
iccProfile: null;
|
|
177
|
+
exifDateTimeOriginal: null;
|
|
178
|
+
} | {
|
|
179
|
+
width: number;
|
|
180
|
+
height: number;
|
|
181
|
+
format: "webp";
|
|
182
|
+
frames: number;
|
|
183
|
+
animated: boolean;
|
|
184
|
+
hasAlpha: boolean;
|
|
185
|
+
colorModel: "unknown" | "rgb" | "rgba";
|
|
186
|
+
orientation: null;
|
|
187
|
+
aspectRatio: number;
|
|
188
|
+
colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
|
|
189
|
+
iccProfile: string | null;
|
|
190
|
+
exifDateTimeOriginal: null;
|
|
191
|
+
} | {
|
|
192
|
+
width: number;
|
|
193
|
+
height: number;
|
|
194
|
+
format: "avif";
|
|
195
|
+
frames: number;
|
|
196
|
+
animated: boolean;
|
|
197
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck";
|
|
198
|
+
hasAlpha: true | null;
|
|
199
|
+
orientation: null;
|
|
200
|
+
aspectRatio: number;
|
|
201
|
+
colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
|
|
202
|
+
iccProfile: string | null;
|
|
203
|
+
exifDateTimeOriginal: string | null;
|
|
204
|
+
}>;
|
|
205
|
+
private readonly signatures;
|
|
206
|
+
/**
|
|
207
|
+
* Probe image from various sources
|
|
208
|
+
* Handles local Buffer, remote URL, or S3 object
|
|
209
|
+
*/
|
|
210
|
+
extractRemote(source: Buffer | string, size?: number, timeout?: number): Promise<ImageSpecs>;
|
|
43
211
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
212
|
+
* Fetch minimal bytes from remote URL using Range header
|
|
213
|
+
* This is the KEY optimization - only fetch what we need!
|
|
46
214
|
*/
|
|
47
|
-
|
|
215
|
+
private knownToBlock;
|
|
216
|
+
private fetchMinimalBuffer;
|
|
217
|
+
getImageSpecsWorkup(rawbuffer: Buffer<ArrayBufferLike>, size?: number): {
|
|
48
218
|
width: number;
|
|
49
219
|
height: number;
|
|
50
|
-
format: "png";
|
|
220
|
+
format: "apng" | "png";
|
|
51
221
|
frames: number;
|
|
52
222
|
animated: boolean;
|
|
53
223
|
hasAlpha: boolean;
|
|
224
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed";
|
|
54
225
|
orientation: null;
|
|
55
226
|
aspectRatio: number;
|
|
56
|
-
colorSpace: "unknown" | "
|
|
227
|
+
colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
|
|
57
228
|
iccProfile: string | null;
|
|
58
229
|
exifDateTimeOriginal: string | null;
|
|
59
230
|
} | {
|
|
@@ -65,7 +236,8 @@ declare class ImageService extends MimeService {
|
|
|
65
236
|
hasAlpha: false;
|
|
66
237
|
orientation: number | null;
|
|
67
238
|
aspectRatio: number;
|
|
68
|
-
colorSpace: "unknown" | "
|
|
239
|
+
colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
|
|
240
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck";
|
|
69
241
|
iccProfile: string | null;
|
|
70
242
|
exifDateTimeOriginal: string | null;
|
|
71
243
|
} | {
|
|
@@ -77,7 +249,8 @@ declare class ImageService extends MimeService {
|
|
|
77
249
|
hasAlpha: null;
|
|
78
250
|
orientation: null;
|
|
79
251
|
aspectRatio: number;
|
|
80
|
-
|
|
252
|
+
colorModel: "indexed";
|
|
253
|
+
colorSpace: "unknown";
|
|
81
254
|
iccProfile: null;
|
|
82
255
|
exifDateTimeOriginal: null;
|
|
83
256
|
} | {
|
|
@@ -89,7 +262,8 @@ declare class ImageService extends MimeService {
|
|
|
89
262
|
hasAlpha: null;
|
|
90
263
|
orientation: number;
|
|
91
264
|
aspectRatio: number;
|
|
92
|
-
|
|
265
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck";
|
|
266
|
+
colorSpace: "unknown";
|
|
93
267
|
iccProfile: null;
|
|
94
268
|
exifDateTimeOriginal: null;
|
|
95
269
|
} | {
|
|
@@ -99,9 +273,10 @@ declare class ImageService extends MimeService {
|
|
|
99
273
|
frames: number;
|
|
100
274
|
animated: boolean;
|
|
101
275
|
hasAlpha: boolean;
|
|
276
|
+
colorModel: "unknown" | "rgb" | "rgba";
|
|
102
277
|
orientation: null;
|
|
103
278
|
aspectRatio: number;
|
|
104
|
-
colorSpace: "unknown" | "
|
|
279
|
+
colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
|
|
105
280
|
iccProfile: string | null;
|
|
106
281
|
exifDateTimeOriginal: null;
|
|
107
282
|
} | {
|
|
@@ -110,10 +285,11 @@ declare class ImageService extends MimeService {
|
|
|
110
285
|
format: "avif";
|
|
111
286
|
frames: number;
|
|
112
287
|
animated: boolean;
|
|
288
|
+
colorModel: "unknown" | "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck";
|
|
113
289
|
hasAlpha: true | null;
|
|
114
290
|
orientation: null;
|
|
115
291
|
aspectRatio: number;
|
|
116
|
-
colorSpace: "unknown" | "
|
|
292
|
+
colorSpace: "unknown" | "cmyk" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "lab" | "xyz" | "gray";
|
|
117
293
|
iccProfile: string | null;
|
|
118
294
|
exifDateTimeOriginal: string | null;
|
|
119
295
|
};
|
package/dist/image/index.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Fs
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LYQ3KQSL.js";
|
|
4
4
|
import {
|
|
5
5
|
FsFetch
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-F57L5MBU.js";
|
|
7
7
|
import {
|
|
8
8
|
FsTmp
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-N33N54TN.js";
|
|
10
10
|
import {
|
|
11
11
|
FsCore
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-HQ2FHXLJ.js";
|
|
13
13
|
import {
|
|
14
14
|
FsSize
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-CJBGTYSB.js";
|
|
16
16
|
import {
|
|
17
17
|
unitsObj
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-4DZLRFGH.js";
|
|
19
19
|
import {
|
|
20
20
|
FsAtomic
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-6UANVLO3.js";
|
|
22
22
|
import {
|
|
23
23
|
FsBase
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-DSH3OL5Q.js";
|
|
25
25
|
import {
|
|
26
26
|
ImageService
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-3MPIZJSN.js";
|
|
28
28
|
import {
|
|
29
29
|
MimeService,
|
|
30
30
|
extMimeMap,
|
package/dist/mime/index.d.ts
CHANGED
|
@@ -488,8 +488,8 @@ declare class MimeService extends UrlService {
|
|
|
488
488
|
compareMimeToExt(p?: "mime" | "ext"): {
|
|
489
489
|
[k: string]: number;
|
|
490
490
|
};
|
|
491
|
-
mimeToExt(mime: keyof typeof this.toExtObj): "png" | "gif" | "bmp" | "webp" | "avif" | "mpd" | "epub" | "ttf" | "gz" | "jar" | "json" | "jsonld" | "webmanifest" | "doc" | "node" | "js" | "bin" | "obj" | "ogx" | "pdf" | "rtf" | "sql" | "toml" | "azw" | "mpkg" | "m3u8" | "pkpass" | "xul" | "xls" | "eot" | "ppt" | "odp" | "ods" | "odt" | "pptx" | "xlsx" | "docx" | "rar" | "vsd" | "wasm" | "7z" | "abw" | "bz" | "bz2" | "cda" | "csh" | "arc" | "php" | "mdx" | "ndjson" | "pyc" | "sh" | "tar" | "zip" | "xhtml" | "xml" | "yml" | "aac" | "mid" | "m4a" | "mp3" | "opus" | "ogg" | "wav" | "weba" | "midi" | "otf" | "woff" | "woff2" | "hjif" | "hmpg" | "ivs" | "aces" | "
|
|
492
|
-
assetType<const T extends string>(url: T): "png" | "jpeg" | "gif" | "bmp" | "webp" | "avif" | "mpd" | "epub" | "ttf" | "gz" | "jar" | "json" | "jsonld" | "webmanifest" | "doc" | "node" | "js" | "bin" | "obj" | "ogx" | "pdf" | "rtf" | "sql" | "toml" | "azw" | "mpkg" | "m3u8" | "pkpass" | "xul" | "xls" | "eot" | "ppt" | "odp" | "ods" | "odt" | "pptx" | "xlsx" | "docx" | "rar" | "vsd" | "wasm" | "7z" | "abw" | "bz" | "bz2" | "cda" | "csh" | "arc" | "php" | "mdx" | "ndjson" | "pyc" | "sh" | "tar" | "zip" | "xhtml" | "xml" | "mtlx" | "yml" | "yaml" | "aac" | "mid" | "m4a" | "mp3" | "opus" | "ogg" | "oga" | "wav" | "weba" | "midi" | "otf" | "woff" | "woff2" | "hjif" | "hmpg" | "ivs" | "ivt" | "aces" | "
|
|
491
|
+
mimeToExt(mime: keyof typeof this.toExtObj): "apng" | "png" | "gif" | "bmp" | "webp" | "avif" | "mpd" | "epub" | "ttf" | "gz" | "jar" | "json" | "jsonld" | "webmanifest" | "doc" | "node" | "js" | "bin" | "obj" | "ogx" | "pdf" | "rtf" | "sql" | "toml" | "azw" | "mpkg" | "m3u8" | "pkpass" | "xul" | "xls" | "eot" | "ppt" | "odp" | "ods" | "odt" | "pptx" | "xlsx" | "docx" | "rar" | "vsd" | "wasm" | "7z" | "abw" | "bz" | "bz2" | "cda" | "csh" | "arc" | "php" | "mdx" | "ndjson" | "pyc" | "sh" | "tar" | "zip" | "xhtml" | "xml" | "yml" | "aac" | "mid" | "m4a" | "mp3" | "opus" | "ogg" | "wav" | "weba" | "midi" | "otf" | "woff" | "woff2" | "hjif" | "hmpg" | "ivs" | "aces" | "avci" | "dpx" | "emf" | "jpg" | "ktx" | "ktx2" | "svg" | "tiff" | "ico" | "cur" | "glb" | "gltf" | "usdz" | "ics" | "css" | "csv" | "sse" | "html" | "md" | "txt" | "rs" | "ts" | "vtt" | "py" | "3gp" | "3g2" | "mp4" | "mpeg" | "ogv" | "webm" | "avi";
|
|
492
|
+
assetType<const T extends string>(url: T): "apng" | "png" | "jpeg" | "gif" | "bmp" | "webp" | "avif" | "mpd" | "epub" | "ttf" | "gz" | "jar" | "json" | "jsonld" | "webmanifest" | "doc" | "node" | "js" | "bin" | "obj" | "ogx" | "pdf" | "rtf" | "sql" | "toml" | "azw" | "mpkg" | "m3u8" | "pkpass" | "xul" | "xls" | "eot" | "ppt" | "odp" | "ods" | "odt" | "pptx" | "xlsx" | "docx" | "rar" | "vsd" | "wasm" | "7z" | "abw" | "bz" | "bz2" | "cda" | "csh" | "arc" | "php" | "mdx" | "ndjson" | "pyc" | "sh" | "tar" | "zip" | "xhtml" | "xml" | "mtlx" | "yml" | "yaml" | "aac" | "mid" | "m4a" | "mp3" | "opus" | "ogg" | "oga" | "wav" | "weba" | "midi" | "otf" | "woff" | "woff2" | "hjif" | "hmpg" | "ivs" | "ivt" | "aces" | "avci" | "dpx" | "emf" | "jpg" | "jpe" | "jif" | "jfif" | "pjp" | "pjpeg" | "ktx" | "ktx2" | "svg" | "tiff" | "tif" | "ico" | "cur" | "glb" | "gltf" | "usdz" | "ics" | "css" | "csv" | "sse" | "html" | "htm" | "mjs" | "cjs" | "md" | "txt" | "rs" | "ts" | "vtt" | "py" | "3gp" | "3g2" | "mp4" | "m4v" | "mpeg" | "ogv" | "webm" | "avi" | undefined;
|
|
493
493
|
getMimes<const E extends FileExtension>(ext: E): readonly ["audio/aac"] | readonly ["application/x-abiword"] | readonly ["image/aces"] | readonly ["image/apng"] | readonly ["application/x-freearc"] | readonly ["image/avci"] | readonly ["image/avif"] | readonly ["video/x-msvideo"] | readonly ["application/vnd.amazon.ebook"] | readonly ["application/octet-stream", "multipart/voice-message"] | readonly ["image/bmp"] | readonly ["application/x-bzip"] | readonly ["application/x-bzip2"] | readonly ["application/x-cdf"] | readonly ["application/node", "text/javascript"] | readonly ["application/x-csh"] | readonly ["text/css"] | readonly ["text/csv"] | readonly ["image/x-icon"] | readonly ["application/msword"] | readonly ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"] | readonly ["image/dpx"] | readonly ["image/emf"] | readonly ["application/vnd.ms-fontobject"] | readonly ["application/epub+zip"] | readonly ["image/gif"] | readonly ["model/gltf-binary"] | readonly ["model/gltf+json"] | readonly ["application/gzip", "application/x-gzip"] | readonly ["haptics/hjif"] | readonly ["haptics/hmpg"] | readonly ["text/html"] | readonly ["image/vnd.microsoft.icon", "image/x-icon"] | readonly ["text/calendar"] | readonly ["haptics/ivs"] | readonly ["application/java-archive"] | readonly ["image/jpeg"] | readonly ["application/json"] | readonly ["application/ld+json"] | readonly ["image/ktx"] | readonly ["image/ktx2"] | readonly ["application/vnd.apple.mpegurl"] | readonly ["audio/mp4"] | readonly ["video/mp4"] | readonly ["text/markdown"] | readonly ["application/x-mdx"] | readonly ["audio/midi"] | readonly ["audio/x-midi"] | readonly ["text/javascript"] | readonly ["audio/mpeg"] | readonly ["application/dash+xml"] | readonly ["video/mpeg"] | readonly ["application/vnd.apple.installer+xml"] | readonly ["application/xml"] | readonly ["application/x-ndjson"] | readonly ["model/obj", "application/octet-stream", "text/plain"] | readonly ["application/vnd.oasis.opendocument.presentation"] | readonly ["application/vnd.oasis.opendocument.spreadsheet"] | readonly ["application/vnd.oasis.opendocument.text"] | readonly ["audio/ogg"] | readonly ["video/ogg"] | readonly ["application/ogg"] | readonly ["font/otf"] | readonly ["image/png"] | readonly ["application/pdf"] | readonly ["application/x-httpd-php"] | readonly ["application/vnd.apple.pkpass"] | readonly ["application/vnd.ms-powerpoint"] | readonly ["application/vnd.openxmlformats-officedocument.presentationml.presentation"] | readonly ["text/x-python"] | readonly ["application/x-python-code"] | readonly ["application/vnd.rar"] | readonly ["text/rust"] | readonly ["application/rtf"] | readonly ["application/x-sh"] | readonly ["application/sql"] | readonly ["text/event-stream"] | readonly ["image/svg+xml"] | readonly ["application/x-tar"] | readonly ["image/tiff"] | readonly ["application/toml"] | readonly ["text/typescript", "video/mp2t", "video/vnd.dlna.mpeg-tts"] | readonly ["application/font-sfnt", "font/ttf"] | readonly ["text/plain"] | readonly ["model/vnd.usdz+zip"] | readonly ["application/vnd.visio"] | readonly ["text/vtt"] | readonly ["application/wasm"] | readonly ["audio/wav"] | readonly ["audio/webm"] | readonly ["video/webm"] | readonly ["application/manifest+json"] | readonly ["image/webp"] | readonly ["font/woff"] | readonly ["font/woff2"] | readonly ["application/xhtml+xml"] | readonly ["application/vnd.ms-excel"] | readonly ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"] | readonly ["application/xml", "text/xml"] | readonly ["application/vnd.mozilla.xul+xml"] | readonly ["application/yaml"] | readonly ["application/zip", "application/x-zip-compressed"] | readonly ["video/3gpp"] | readonly ["video/3gpp2"] | readonly ["application/x-7z-compressed"];
|
|
494
494
|
getMimeFor<const E extends FileExtension>(ext: E, opts?: {
|
|
495
495
|
type?: MimeTopLevelType;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -315,13 +315,14 @@ type SizeOpts = {
|
|
|
315
315
|
interface ImageSpecs {
|
|
316
316
|
width: number;
|
|
317
317
|
height: number;
|
|
318
|
-
format: "png" | "jpeg" | "gif" | "bmp" | "webp" | "avif" | "unknown";
|
|
318
|
+
format: "apng" | "png" | "jpeg" | "gif" | "bmp" | "webp" | "avif" | "unknown";
|
|
319
319
|
frames: number;
|
|
320
320
|
animated: boolean;
|
|
321
321
|
hasAlpha: boolean | null;
|
|
322
322
|
orientation: number | null;
|
|
323
323
|
aspectRatio: number;
|
|
324
|
-
|
|
324
|
+
colorModel: "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "unknown";
|
|
325
|
+
colorSpace: "unknown" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "cmyk" | "lab" | "xyz" | "gray";
|
|
325
326
|
iccProfile: string | null;
|
|
326
327
|
exifDateTimeOriginal: string | null;
|
|
327
328
|
}
|
package/dist/types/index.js
CHANGED
package/dist/types/stream.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ReadableStream } from 'stream/web';
|
|
2
|
+
import { Readable } from 'node:stream';
|
|
2
3
|
|
|
3
4
|
type Bin = Buffer | Uint8Array;
|
|
4
5
|
type WebRS = ReadableStream<Uint8Array>;
|
|
5
6
|
type AsyncIter = AsyncIterable<Uint8Array>;
|
|
6
7
|
/** Inputs you actually accept — no `any`, no lies. */
|
|
7
|
-
type Streamable = string | Bin | WebRS | AsyncIter;
|
|
8
|
+
type Streamable = string | Bin | WebRS | AsyncIter | Readable;
|
|
8
9
|
|
|
9
10
|
export type { AsyncIter, Bin, Streamable, WebRS };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d0paminedriven/fs",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.5.0",
|
|
4
4
|
"homepage": "https://github.com/DopamineDriven/d0paminedriven/blob/master/packages/fs/README.md",
|
|
5
5
|
"author": {
|
|
6
6
|
"email": "andrew@windycitydevs.io",
|
|
@@ -94,6 +94,7 @@
|
|
|
94
94
|
"dependencies": {
|
|
95
95
|
"dotenv": "^17.2.1",
|
|
96
96
|
"dotenv-expand": "^12.0.2",
|
|
97
|
+
"fflate": "^0.8.2",
|
|
97
98
|
"sharp": "^0.34.3"
|
|
98
99
|
},
|
|
99
100
|
"devDependencies": {
|
|
@@ -110,8 +111,8 @@
|
|
|
110
111
|
"typescript": "^5.9.2",
|
|
111
112
|
"typescript-eslint": "^8.40.0",
|
|
112
113
|
"@d0paminedriven/eslint-config": "0.1.0",
|
|
113
|
-
"@d0paminedriven/
|
|
114
|
-
"@d0paminedriven/
|
|
114
|
+
"@d0paminedriven/tsconfig": "0.1.0",
|
|
115
|
+
"@d0paminedriven/prettier-config": "0.1.0"
|
|
115
116
|
},
|
|
116
117
|
"prettier": "@d0paminedriven/prettier-config",
|
|
117
118
|
"scripts": {
|