m4k 0.1.1 → 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.
@@ -1,4 +1,4 @@
1
- import { type ImageOptimizerOptions, ConvertedFile } from "@m4k/types";
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/types";
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
@@ -0,0 +1,4 @@
1
+ export * from "@m4k/common";
2
+ export { imageQueue, optimizeImage } from "./images/image-optimizer";
3
+ export { getExtension, optimizeVideo, tmpVideoDir, videoQueue } from "./videos/video-optimizer";
4
+ //# sourceMappingURL=index.d.ts.map
package/lib/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export * from "@m4k/common";
2
+ export { imageQueue, optimizeImage } from "./images/image-optimizer";
3
+ export { getExtension, optimizeVideo, tmpVideoDir, videoQueue } from "./videos/video-optimizer";
4
+ //# sourceMappingURL=index.js.map
@@ -2,3 +2,4 @@
2
2
  * Mapping from file extensions to their corresponding MIME types
3
3
  */
4
4
  export declare const mimeTypes: Record<string, string>;
5
+ //# sourceMappingURL=mime.d.ts.map
@@ -49,3 +49,4 @@ export const mimeTypes = {
49
49
  aiff: "audio/aiff",
50
50
  alac: "audio/alac",
51
51
  };
52
+ //# sourceMappingURL=mime.js.map
@@ -1,3 +1,4 @@
1
1
  import { Readable } from "node:stream";
2
2
  export declare function readableFromWeb(stream: ReadableStream): Readable;
3
3
  export declare function readableToWeb(stream: Readable): ReadableStream & AsyncIterable<Uint8Array>;
4
+ //# sourceMappingURL=streams.d.ts.map
@@ -6,3 +6,4 @@ export function readableFromWeb(stream) {
6
6
  export function readableToWeb(stream) {
7
7
  return Readable.toWeb(stream);
8
8
  }
9
+ //# sourceMappingURL=streams.js.map
@@ -1,4 +1,4 @@
1
- import { ConvertedFile, type VideoOptimizerOptions } from "@m4k/types";
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/types";
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
- "module": "./dist/index.js",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
- "version": "0.1.1",
6
- "main": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
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 tsc",
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
@@ -1,3 +0,0 @@
1
- export { ConvertedFile } from "@m4k/types";
2
- export { imageQueue, optimizeImage } from "./images/image-optimizer";
3
- export { getExtension, optimizeVideo, tmpVideoDir, videoQueue, } from "./videos/video-optimizer";
package/dist/index.js DELETED
@@ -1,3 +0,0 @@
1
- export { ConvertedFile } from "@m4k/types";
2
- export { imageQueue, optimizeImage } from "./images/image-optimizer";
3
- export { getExtension, optimizeVideo, tmpVideoDir, videoQueue, } from "./videos/video-optimizer";