m4k 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{dist → lib}/images/image-optimizer.d.ts +2 -1
- package/{dist → lib}/images/image-optimizer.js +2 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.js +4 -0
- package/{dist → lib}/util/mime.d.ts +1 -0
- package/{dist → lib}/util/mime.js +1 -0
- package/{dist → lib}/util/streams.d.ts +1 -0
- package/{dist → lib}/util/streams.js +1 -0
- package/{dist → lib}/videos/video-optimizer.d.ts +2 -1
- package/{dist → lib}/videos/video-optimizer.js +2 -1
- package/package.json +10 -6
- package/LICENSE +0 -21
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ImageOptimizerOptions, ConvertedFile } from "@m4k/
|
|
1
|
+
import { type ImageOptimizerOptions, ConvertedFile } from "@m4k/common";
|
|
2
2
|
export type Format = Required<ImageOptimizerOptions>["format"];
|
|
3
3
|
export type Fit = Required<Required<ImageOptimizerOptions>["resize"]>["fit"];
|
|
4
4
|
export declare function optimizeImage(input: ReadableStream | Blob, opts: ImageOptimizerOptions | ImageOptimizerOptions[], signal?: AbortSignal): AsyncGenerator<ConvertedFile | {
|
|
@@ -7,3 +7,4 @@ export declare function optimizeImage(input: ReadableStream | Blob, opts: ImageO
|
|
|
7
7
|
position: number;
|
|
8
8
|
}, void, unknown> | null;
|
|
9
9
|
export declare const imageQueue: import("tasque").Tasque;
|
|
10
|
+
//# sourceMappingURL=image-optimizer.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConvertedFile } from "@m4k/
|
|
1
|
+
import { ConvertedFile } from "@m4k/common";
|
|
2
2
|
import sharp from "sharp";
|
|
3
3
|
import { createQueue } from "tasque";
|
|
4
4
|
import { readableFromWeb, readableToWeb } from "../util/streams";
|
|
@@ -56,3 +56,4 @@ export const imageQueue = createQueue({
|
|
|
56
56
|
parallelize: Number(process.env.IMAGE_PARALLELIZE ?? 5),
|
|
57
57
|
max: Number(process.env.IMAGE_QUEUE_SIZE ?? 100),
|
|
58
58
|
});
|
|
59
|
+
//# sourceMappingURL=image-optimizer.js.map
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConvertedFile, type VideoOptimizerOptions } from "@m4k/
|
|
1
|
+
import { ConvertedFile, type VideoOptimizerOptions } from "@m4k/common";
|
|
2
2
|
export declare function optimizeVideo(inputPath: string, opts: VideoOptimizerOptions, signal?: AbortSignal): AsyncGenerator<ConvertedFile | {
|
|
3
3
|
progress: number;
|
|
4
4
|
} | {
|
|
@@ -13,3 +13,4 @@ export declare function optimizeVideo(inputPath: string, opts: VideoOptimizerOpt
|
|
|
13
13
|
export declare function getExtension(format: string): string;
|
|
14
14
|
export declare const videoQueue: import("tasque").Tasque;
|
|
15
15
|
export declare const tmpVideoDir: string;
|
|
16
|
+
//# sourceMappingURL=video-optimizer.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConvertedFile } from "@m4k/
|
|
1
|
+
import { ConvertedFile } from "@m4k/common";
|
|
2
2
|
import { spawn } from "node:child_process";
|
|
3
3
|
import { getRandomValues } from "node:crypto";
|
|
4
4
|
import { mkdir, rm } from "node:fs/promises";
|
|
@@ -122,3 +122,4 @@ const ffmpeg = process.env.FFMPEG_PATH ?? (await import("@ffmpeg-installer/ffmpe
|
|
|
122
122
|
const extMap = {
|
|
123
123
|
matroska: "mkv",
|
|
124
124
|
};
|
|
125
|
+
//# sourceMappingURL=video-optimizer.js.map
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "m4k",
|
|
3
|
-
"
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
5
|
+
"main": "./lib/index.js",
|
|
6
|
+
"types": "./lib/index.d.ts",
|
|
7
|
+
"module": "./lib/index.js",
|
|
8
|
+
"license": "MIT",
|
|
8
9
|
"scripts": {
|
|
9
|
-
"prepublishOnly": "bun
|
|
10
|
-
"build": "tsc",
|
|
10
|
+
"prepublishOnly": "bun run build",
|
|
11
|
+
"build": "tsc -b",
|
|
11
12
|
"typecheck": "tsc --noEmit",
|
|
12
13
|
"test": "bun test"
|
|
13
14
|
},
|
|
@@ -16,6 +17,9 @@
|
|
|
16
17
|
"tasque": "^0.1.2",
|
|
17
18
|
"typescript": "^5.0.0"
|
|
18
19
|
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@m4k/common": "^0.1.0"
|
|
22
|
+
},
|
|
19
23
|
"peerDependencies": {
|
|
20
24
|
"sharp": "^0.33.5"
|
|
21
25
|
},
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Sven
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED