getwebp 1.0.0 → 1.0.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/dist/index.js +17 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9,9 +9,11 @@ import jwt from "jsonwebtoken";
|
|
|
9
9
|
|
|
10
10
|
// src/core/config.ts
|
|
11
11
|
import Conf from "conf";
|
|
12
|
-
import { machineIdSync } from "node-machine-id";
|
|
13
12
|
import crypto from "node:crypto";
|
|
13
|
+
import { createRequire } from "node:module";
|
|
14
14
|
import os from "node:os";
|
|
15
|
+
var _require = createRequire(import.meta.url);
|
|
16
|
+
var { machineIdSync } = _require("node-machine-id");
|
|
15
17
|
function getMachineKey() {
|
|
16
18
|
try {
|
|
17
19
|
const id = machineIdSync();
|
|
@@ -42,8 +44,10 @@ function saveConfig(data) {
|
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
// src/core/device.ts
|
|
45
|
-
import { machineId } from "node-machine-id";
|
|
46
47
|
import crypto2 from "node:crypto";
|
|
48
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
49
|
+
var _require2 = createRequire2(import.meta.url);
|
|
50
|
+
var { machineId } = _require2("node-machine-id");
|
|
47
51
|
async function getDeviceId() {
|
|
48
52
|
const id = await machineId();
|
|
49
53
|
return crypto2.createHash("sha256").update(id).digest("hex");
|
|
@@ -339,23 +343,23 @@ async function collectImageFiles(input, recursive) {
|
|
|
339
343
|
|
|
340
344
|
// src/core/wasm-init.ts
|
|
341
345
|
import { readFileSync } from "node:fs";
|
|
342
|
-
import { createRequire } from "node:module";
|
|
343
|
-
import { init as initPngCodec } from "@jsquash/png/decode";
|
|
344
|
-
import { init as initJpegDec } from "@jsquash/jpeg/decode";
|
|
345
|
-
import { init as initWebpDec } from "@jsquash/webp/decode";
|
|
346
|
-
import { init as initWebpEnc } from "@jsquash/webp/encode";
|
|
347
|
-
var
|
|
346
|
+
import { createRequire as createRequire3 } from "node:module";
|
|
347
|
+
import { init as initPngCodec } from "@jsquash/png/decode.js";
|
|
348
|
+
import { init as initJpegDec } from "@jsquash/jpeg/decode.js";
|
|
349
|
+
import { init as initWebpDec } from "@jsquash/webp/decode.js";
|
|
350
|
+
import { init as initWebpEnc } from "@jsquash/webp/encode.js";
|
|
351
|
+
var _require3 = createRequire3(import.meta.url);
|
|
348
352
|
var initialized = false;
|
|
349
353
|
async function initWasm() {
|
|
350
354
|
if (initialized) return;
|
|
351
355
|
initialized = true;
|
|
352
|
-
const pngWasm = new WebAssembly.Module(readFileSync(
|
|
356
|
+
const pngWasm = new WebAssembly.Module(readFileSync(_require3.resolve("@jsquash/png/codec/pkg/squoosh_png_bg.wasm")));
|
|
353
357
|
await initPngCodec(pngWasm);
|
|
354
|
-
const jpegWasm = new WebAssembly.Module(readFileSync(
|
|
358
|
+
const jpegWasm = new WebAssembly.Module(readFileSync(_require3.resolve("@jsquash/jpeg/codec/dec/mozjpeg_dec.wasm")));
|
|
355
359
|
await initJpegDec(jpegWasm);
|
|
356
|
-
const webpDecWasm = new WebAssembly.Module(readFileSync(
|
|
360
|
+
const webpDecWasm = new WebAssembly.Module(readFileSync(_require3.resolve("@jsquash/webp/codec/dec/webp_dec.wasm")));
|
|
357
361
|
await initWebpDec(webpDecWasm);
|
|
358
|
-
const webpEncWasm = new WebAssembly.Module(readFileSync(
|
|
362
|
+
const webpEncWasm = new WebAssembly.Module(readFileSync(_require3.resolve("@jsquash/webp/codec/enc/webp_enc.wasm")));
|
|
359
363
|
await initWebpEnc(webpEncWasm);
|
|
360
364
|
}
|
|
361
365
|
|
|
@@ -734,7 +738,7 @@ function authCommand(cli2) {
|
|
|
734
738
|
}
|
|
735
739
|
|
|
736
740
|
// src/version.ts
|
|
737
|
-
var VERSION = true ? "1.0.
|
|
741
|
+
var VERSION = true ? "1.0.1" : await getDevVersion();
|
|
738
742
|
|
|
739
743
|
// src/commands/status.ts
|
|
740
744
|
function statusCommand(cli2) {
|