@boruto_vk7/stickengine 4.2.0 → 4.2.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @boruto_vk7/stickengine
2
2
 
3
- > **4.2.0 — TURBO**: WebP animado agora é codificado **em paralelo** (um processo ffmpeg por núcleo, até 4) e os pedaços são remontados byte a byte, sem recodificar a junção. Defaults de velocidade: `fps` 15→12, `quality` animado 80→75, `compressionLevel` 6→1 (6 multiplicava o tempo de encode), auto-shrink proporcional (≤3 tentativas) e ffmpeg do sistema preferido quando tem `libwebp`. Um clipe de 4s que levava ~20s numa VPS fraca agora sai em poucos segundos. Desative o paralelismo com `parallelChunks: 1`.
3
+ > **4.2.1 — TURBO**: WebP animado agora é codificado **em paralelo** (um processo ffmpeg por núcleo, até 4) e os pedaços são remontados byte a byte, sem recodificar a junção. Defaults de velocidade: `fps` 15→12, `quality` animado 80→75, `compressionLevel` 6→1 (6 multiplicava o tempo de encode), auto-shrink proporcional (≤3 tentativas) e ffmpeg do sistema preferido quando tem `libwebp`. Um clipe de 4s que levava ~20s numa VPS fraca agora sai em poucos segundos. Desative o paralelismo com `parallelChunks: 1`.
4
4
 
5
5
 
6
6
  [![npm](https://img.shields.io/npm/v/@boruto_vk7/stickengine)](https://www.npmjs.com/package/@boruto_vk7/stickengine)
@@ -1277,7 +1277,11 @@ class StickEngine extends node_events_1.EventEmitter {
1277
1277
  k = Math.round(Number(opt) || 0);
1278
1278
  }
1279
1279
  else {
1280
- const cores = Math.max(1, node_os_1.default.cpus().length);
1280
+ // availableParallelism respeita a cota de CPU do container (VPS/Docker);
1281
+ // cpus() vê os núcleos do host e superestima em planos pequenos
1282
+ const cores = typeof node_os_1.default.availableParallelism === 'function'
1283
+ ? node_os_1.default.availableParallelism()
1284
+ : node_os_1.default.cpus().length;
1281
1285
  k = Math.min(4, Math.max(1, Math.ceil(cores * 0.75)));
1282
1286
  }
1283
1287
  k = Math.max(1, Math.min(8, k));
@@ -1262,7 +1262,11 @@ export class StickEngine extends EventEmitter {
1262
1262
  k = Math.round(Number(opt) || 0);
1263
1263
  }
1264
1264
  else {
1265
- const cores = Math.max(1, os.cpus().length);
1265
+ // availableParallelism respeita a cota de CPU do container (VPS/Docker);
1266
+ // cpus() vê os núcleos do host e superestima em planos pequenos
1267
+ const cores = typeof os.availableParallelism === 'function'
1268
+ ? os.availableParallelism()
1269
+ : os.cpus().length;
1266
1270
  k = Math.min(4, Math.max(1, Math.ceil(cores * 0.75)));
1267
1271
  }
1268
1272
  k = Math.max(1, Math.min(8, k));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boruto_vk7/stickengine",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "description": "WhatsApp sticker engine - media preparation only: 512x512 static/animated WebP, parallel animated encoding, automatic black-border removal, full-bleed cover fit, audio sticker pair (WebP + OGG/Opus), bundled canvas and ffmpeg binaries, pack EXIF, chalk logging. No message sending, no Baileys coupling.",
5
5
  "author": "Borutovk7 - Lagos Solutions",
6
6
  "license": "MIT",