@divriots/jampack 0.1.1 → 0.1.3

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,3 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
1
  import sharp from 'sharp';
3
2
  import type { Result } from './types.js';
4
3
  export declare const compressImage: (data: Buffer, resize: sharp.ResizeOptions) => Promise<Buffer | undefined>;
package/dist/compress.js CHANGED
@@ -50,9 +50,15 @@ const addProgress = (r) => {
50
50
  };
51
51
  const printProgress = (r) => {
52
52
  addProgress(r);
53
- process.stdout.clearLine(0);
54
- process.stdout.cursorTo(0);
55
- process.stdout.write(`${state.total.nbFiles} files | ${formatBytes(state.total.dataLenUncompressed)} → ${formatBytes(state.total.dataLenCompressed)}`);
53
+ const msg = `${state.total.nbFiles} files | ${formatBytes(state.total.dataLenUncompressed)} → ${formatBytes(state.total.dataLenCompressed)}`;
54
+ if (!process.stdout.cursorTo) {
55
+ // In CI we don't have access to cursorTo
56
+ console.log(msg);
57
+ }
58
+ else {
59
+ process.stdout.cursorTo(0);
60
+ process.stdout.write(msg);
61
+ }
56
62
  };
57
63
  const endProgress = () => {
58
64
  process.stdout.write('\n');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@divriots/jampack",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Packer for static websites",
5
5
  "author": "Georges Gomes @georges-gomes",
6
6
  "bin": {