@naturalcycles/nodejs-lib 15.90.2 → 15.91.0

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/fs/fs2.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { RmOptions } from 'node:fs';
2
2
  import fs from 'node:fs';
3
+ import fsp from 'node:fs/promises';
3
4
  /**
4
5
  * fs2 conveniently groups filesystem functions together.
5
6
  * Supposed to be almost a drop-in replacement for these things together:
@@ -61,15 +62,15 @@ declare class FS2 {
61
62
  */
62
63
  isDirectory(filePath: string): boolean;
63
64
  fs: typeof fs;
64
- fsp: typeof fs.promises;
65
+ fsp: typeof fsp;
65
66
  lstat: fs.StatSyncFn;
66
- lstatAsync: typeof fs.promises.lstat;
67
+ lstatAsync: typeof fsp.lstat;
67
68
  stat: fs.StatSyncFn;
68
- statAsync: typeof fs.promises.stat;
69
+ statAsync: typeof fsp.stat;
69
70
  mkdir: typeof fs.mkdirSync;
70
- mkdirAsync: typeof fs.promises.mkdir;
71
+ mkdirAsync: typeof fsp.mkdir;
71
72
  readdir: typeof fs.readdirSync;
72
- readdirAsync: typeof fs.promises.readdir;
73
+ readdirAsync: typeof fsp.readdir;
73
74
  createWriteStream: typeof fs.createWriteStream;
74
75
  createReadStream: typeof fs.createReadStream;
75
76
  }
package/dist/fs/kpy.js CHANGED
@@ -12,7 +12,7 @@ export async function kpy(opt) {
12
12
  });
13
13
  kpyLogFilenames(opt, filenames);
14
14
  const overwrite = !opt.noOverwrite;
15
- await Promise.all(filenames.map(async (filename) => {
15
+ await Promise.all(filenames.map(async filename => {
16
16
  const basename = path.basename(filename);
17
17
  const srcFilename = path.resolve(opt.baseDir, filename);
18
18
  const destFilename = path.resolve(opt.outputDir, opt.flat ? basename : filename);
@@ -97,8 +97,7 @@ export declare class Pipeline<T = unknown> {
97
97
  parseJson<TO = unknown>(this: Pipeline<Buffer> | Pipeline<Uint8Array> | Pipeline<string>): Pipeline<TO>;
98
98
  gzip(this: Pipeline<Uint8Array>, opt?: ZlibOptions): Pipeline<Uint8Array>;
99
99
  gunzip(this: Pipeline<Uint8Array>, opt?: ZlibOptions): Pipeline<Uint8Array>;
100
- zstdCompress(this: Pipeline<Uint8Array>, level?: Integer, // defaults to 3
101
- opt?: ZstdOptions): Pipeline<Uint8Array>;
100
+ zstdCompress(this: Pipeline<Uint8Array>, level?: Integer, opt?: ZstdOptions): Pipeline<Uint8Array>;
102
101
  zstdDecompress(this: Pipeline<Uint8Array>, opt?: ZstdOptions): Pipeline<Uint8Array>;
103
102
  toArray(opt?: TransformOptions): Promise<T[]>;
104
103
  toFile(outputFilePath: string): Promise<void>;
@@ -299,9 +299,7 @@ export class Pipeline {
299
299
  else if (outputFilePath.endsWith('.zst')) {
300
300
  this.transforms.push(createZstdCompress(zstdLevelToOptions(level)));
301
301
  }
302
- this.destination = fs2.createWriteStream(outputFilePath, {
303
- // highWaterMark: 64 * 1024, // no observed speedup
304
- });
302
+ this.destination = fs2.createWriteStream(outputFilePath, {});
305
303
  await this.run();
306
304
  }
307
305
  async to(destination) {