@types/tar 6.1.13 → 7.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.
Files changed (3) hide show
  1. tar/README.md +3 -15
  2. tar/package.json +5 -26
  3. tar/index.d.ts +0 -965
tar/README.md CHANGED
@@ -1,15 +1,3 @@
1
- # Installation
2
- > `npm install --save @types/tar`
3
-
4
- # Summary
5
- This package contains type definitions for tar (https://github.com/npm/node-tar).
6
-
7
- # Details
8
- Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/tar.
9
-
10
- ### Additional Details
11
- * Last updated: Thu, 18 Apr 2024 00:23:15 GMT
12
- * Dependencies: [@types/node](https://npmjs.com/package/@types/node), [minipass](https://npmjs.com/package/minipass)
13
-
14
- # Credits
15
- These definitions were written by [Maxime LUCE](https://github.com/SomaticIT), and [Connor Peet](https://github.com/connor4312).
1
+ This is a stub types definition for @types/tar (https://github.com/isaacs/node-tar#readme).
2
+
3
+ tar provides its own type definitions, so you don't need @types/tar installed!
tar/package.json CHANGED
@@ -1,33 +1,12 @@
1
1
  {
2
2
  "name": "@types/tar",
3
- "version": "6.1.13",
4
- "description": "TypeScript definitions for tar",
5
- "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/tar",
6
- "license": "MIT",
7
- "contributors": [
8
- {
9
- "name": "Maxime LUCE",
10
- "githubUsername": "SomaticIT",
11
- "url": "https://github.com/SomaticIT"
12
- },
13
- {
14
- "name": "Connor Peet",
15
- "githubUsername": "connor4312",
16
- "url": "https://github.com/connor4312"
17
- }
18
- ],
3
+ "version": "7.0.1",
4
+ "description": "Stub TypeScript definitions entry for tar, which provides its own types definitions",
19
5
  "main": "",
20
- "types": "index.d.ts",
21
- "repository": {
22
- "type": "git",
23
- "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
24
- "directory": "types/tar"
25
- },
26
6
  "scripts": {},
7
+ "license": "MIT",
27
8
  "dependencies": {
28
- "@types/node": "*",
29
- "minipass": "^4.0.0"
9
+ "tar": "*"
30
10
  },
31
- "typesPublisherContentHash": "21bfcbacede4f9d98d455e762fb5bf22078fee340a2b25bd1241d7a9f8c44784",
32
- "typeScriptVersion": "4.7"
11
+ "deprecated": "This is a stub types definition. tar provides its own type definitions, so you do not need this installed."
33
12
  }
tar/index.d.ts DELETED
@@ -1,965 +0,0 @@
1
- /// <reference types="node" />
2
-
3
- import stream = require("stream");
4
- import zlib = require("zlib");
5
- import MiniPass = require("minipass");
6
- import fs = require("fs");
7
-
8
- // #region Interfaces
9
-
10
- export interface HeaderProperties {
11
- path: string;
12
- mode?: number | undefined;
13
- noProprietary?: boolean | undefined;
14
- uid?: number | undefined;
15
- gid?: number | undefined;
16
- size?: number | undefined;
17
- mtime?: number | undefined;
18
- type?: string | undefined;
19
- uname?: string | undefined;
20
- gname?: string | undefined;
21
- devmaj?: number | undefined;
22
- devmin?: number | undefined;
23
- }
24
-
25
- export interface ParseStream extends NodeJS.ReadWriteStream {
26
- position: number;
27
-
28
- _stream: stream.Stream;
29
- _ended: boolean;
30
-
31
- _streamEnd(): void;
32
- _process(c: Buffer): void;
33
- _startEntry(c: Buffer): void;
34
- }
35
-
36
- export interface PackStream extends NodeJS.ReadWriteStream {
37
- writable: boolean;
38
- readable: boolean;
39
-
40
- _noProprietary: boolean;
41
- _global: HeaderProperties;
42
- _buffer: stream.Stream[];
43
- _currentEntry: any;
44
- _processing: boolean;
45
- _pipeRoot: stream.Stream;
46
- _needDrain: boolean;
47
- _paused: boolean;
48
-
49
- addGlobal(props: HeaderProperties): void;
50
- add(stream: stream.Stream): boolean;
51
- destroy(): void;
52
-
53
- _process(): void;
54
- }
55
-
56
- // #endregion
57
-
58
- // #region Enums
59
-
60
- export interface Fields {
61
- path: number;
62
- mode: number;
63
- uid: number;
64
- gid: number;
65
- size: number;
66
- mtime: number;
67
- cksum: number;
68
- type: number;
69
- linkpath: number;
70
- ustar: number;
71
- ustarvar: number;
72
- uname: number;
73
- gname: number;
74
- devmaj: number;
75
- devmin: number;
76
- prefix: number;
77
- fill: number;
78
- }
79
-
80
- export type fields = Fields; // alias for backwards compatbility
81
-
82
- export const fieldSize: number[];
83
- export const fieldOffs: number[];
84
- export const fieldEnds: number[];
85
-
86
- /**
87
- * Different values of the 'type' field
88
- * paths match the values of Stats.isX() functions, where appropriate
89
- */
90
- export const types: {
91
- 0: string;
92
- "\0": string;
93
- "": string;
94
- 1: string;
95
- 2: string;
96
- 3: string;
97
- 4: string;
98
- 5: string;
99
- 6: string;
100
- 7: string;
101
- g: string;
102
- x: string;
103
- A: string;
104
- D: string;
105
- I: string;
106
- K: string;
107
- L: string;
108
- M: string;
109
- N: string;
110
- S: string;
111
- V: string;
112
- X: string;
113
- File: string;
114
- OldFile: string;
115
- Link: string;
116
- SymbolicLick: string;
117
- CharacterDevice: string;
118
- BlockDevice: string;
119
- Directory: string;
120
- FIFO: string;
121
- ContiguousFile: string;
122
- GlobalExtendedHeader: string;
123
- ExtendedHeader: string;
124
- SolarisACL: string;
125
- GNUDumpDir: string;
126
- INode: string;
127
- NextFileHasLonLinkPath: string;
128
- NextFileHasLongPath: string;
129
- ContinuationFile: string;
130
- TapeVolumeHeader: string;
131
- OldExtendedHeader: string;
132
- };
133
-
134
- /**
135
- * Values for the mode field
136
- */
137
- export const modes: {
138
- suid: number;
139
- sgid: number;
140
- svtx: number;
141
- uread: number;
142
- uwrite: number;
143
- uexec: number;
144
- gread: number;
145
- gwrite: number;
146
- gexec: number;
147
- oread: number;
148
- owrite: number;
149
- oexec: number;
150
- };
151
-
152
- export const numeric: {
153
- mode: boolean;
154
- uid: boolean;
155
- gid: boolean;
156
- size: boolean;
157
- mtime: boolean;
158
- devmaj: boolean;
159
- devmin: boolean;
160
- cksum: boolean;
161
- atime: boolean;
162
- ctime: boolean;
163
- dev: boolean;
164
- ino: boolean;
165
- nlink: boolean;
166
- };
167
-
168
- export const knownExtended: {
169
- atime: boolean;
170
- charset: boolean;
171
- comment: boolean;
172
- ctime: boolean;
173
- gid: boolean;
174
- gname: boolean;
175
- linkpat: boolean;
176
- mtime: boolean;
177
- path: boolean;
178
- realtime: boolean;
179
- security: boolean;
180
- size: boolean;
181
- uid: boolean;
182
- uname: boolean;
183
- };
184
-
185
- export const headerSize: number;
186
- export const blockSize: number;
187
-
188
- export interface ParseOptions {
189
- strict?: boolean;
190
- filter?: (path: string, entry: ReadEntry) => boolean;
191
- onentry?: (entry: ReadEntry) => void;
192
- onwarn?: (code: string, message: string, data: Buffer) => void;
193
- }
194
- /**
195
- * A writable stream. Write tar data to it and it will emit entry events for each entry parsed from the tarball. This is used by tar.Extract.
196
- */
197
- export interface Parse extends ParseStream {
198
- on(event: "end" | "close", listener: () => void): this;
199
- on(event: "entry", listener: (entry: ReadEntry) => void): this;
200
- }
201
-
202
- export const Parse: {
203
- new(opt?: ParseOptions): Parse;
204
- };
205
- // #endregion
206
-
207
- // #region Global Methods
208
-
209
- export interface PackOptions {
210
- /**
211
- * A function that will get called with (code, message, data) for any
212
- * warnings encountered. (See "Warnings and Errors")
213
- */
214
- onwarn?(code: string, message: string, data: Buffer): void;
215
- /**
216
- * Treat warnings as crash-worthy errors.
217
- *
218
- * @default false
219
- */
220
- strict?: boolean;
221
- /**
222
- * The current working directory for creating the archive.
223
- *
224
- * @default process.cwd()
225
- */
226
- cwd?: string;
227
- /**
228
- * A path portion to prefix onto the entries in the archive.
229
- */
230
- prefix?: string;
231
- /**
232
- * Set to any truthy value to create a gzipped archive, or an object with
233
- * settings for zlib.Gzip()
234
- */
235
- gzip?: boolean | zlib.ZlibOptions;
236
- /**
237
- * Set to any truthy value to create a brotli-compressed archive,
238
- * or an object with settings for zlib.BrotliCompress()
239
- */
240
- brotli?: boolean | zlib.BrotliOptions;
241
- /**
242
- * A function that gets called with (path, stat) for each entry being added.
243
- * Return true to add the entry to the archive, or false to omit it.
244
- */
245
- filter?(path: string, stat: fs.Stats): boolean;
246
- /**
247
- * Omit metadata that is system-specific: ctime, atime, uid, gid, uname,
248
- * gname, dev, ino, and nlink. Note that mtime is still included, because
249
- * this is necessary for other time-based operations. Additionally, mode is
250
- * set to a "reasonable default" for most unix systems, based on a umask
251
- * value of 0o22.
252
- */
253
- portable?: boolean;
254
- /**
255
- * Allow absolute paths. By default, / is stripped from absolute paths.
256
- */
257
- preservePaths?: boolean;
258
- /**
259
- * A Map object containing the device and inode value for any file whose
260
- * nlink is > 1, to identify hard links.
261
- */
262
- linkCache?: Map<string, string>;
263
- /**
264
- * A Map object that caches calls lstat.
265
- */
266
- statCache?: Map<string, string>;
267
- /**
268
- * A Map object that caches calls to readdir.
269
- */
270
- readdirCache?: Map<string, string>;
271
- /**
272
- * A number specifying how many concurrent jobs to run.
273
- *
274
- * @default 4
275
- */
276
- jobs?: number;
277
- /**
278
- * The maximum buffer size for fs.read() operations.
279
- *
280
- * @default 16 MB
281
- */
282
- maxReadSize?: number;
283
- /**
284
- * Do not recursively archive the contents of directories.
285
- */
286
- noDirRecurse?: boolean;
287
- /**
288
- * Set to true to pack the targets of symbolic links. Without this option,
289
- * symbolic links are archived as such.
290
- */
291
- follow?: boolean;
292
- /**
293
- * Suppress pax extended headers. Note that this means that long paths and
294
- * linkpaths will be truncated, and large or negative numeric values may be
295
- * interpreted incorrectly.
296
- */
297
- noPax?: boolean;
298
- /**
299
- * Set to true to omit writing mtime values for entries. Note that this
300
- * prevents using other mtime-based features like tar.update or the
301
- * keepNewer option with the resulting tar archive.
302
- */
303
- noMtime?: boolean;
304
- /**
305
- * Set to a Date object to force a specific mtime for everything added to
306
- * the archive. Overridden by noMtime.
307
- */
308
- mtime?: Date;
309
- }
310
-
311
- /**
312
- * Returns a through stream. Use fstream to write files into the pack stream and you will receive tar archive data from the pack stream.
313
- * This only works with directories, it does not work with individual files.
314
- * The optional properties object are used to set properties in the tar 'Global Extended Header'.
315
- */
316
- export class Pack extends MiniPass {
317
- linkCache: PackOptions["linkCache"];
318
- readdirCache: PackOptions["readdirCache"];
319
- statCache: PackOptions["statCache"];
320
-
321
- static Sync: typeof PackSync;
322
-
323
- constructor(opt?: PackOptions);
324
-
325
- add(path: string): this;
326
- }
327
-
328
- declare class PackSync extends Pack {
329
- constructor(opt: PackOptions);
330
-
331
- // pause/resume are no-ops in sync streams.
332
- pause(): void;
333
- resume(): void;
334
- }
335
-
336
- declare class PackJob {
337
- path: string;
338
- absolute: string;
339
- entry: unknown | null;
340
- stat: unknown | null;
341
- readdir: unknown | null;
342
- pending: boolean;
343
- ignore: boolean;
344
- piped: boolean;
345
-
346
- constructor(path?: string, absolute?: string);
347
- }
348
-
349
- /**
350
- * Returns a through stream. Write tar data to the stream and the files in the tarball will be extracted onto the filesystem.
351
- * options can be:
352
- * ```
353
- * {
354
- * path: '/path/to/extract/tar/into',
355
- * strip: 0, // how many path segments to strip from the root when extracting
356
- * }
357
- * ```
358
- * options also get passed to the fstream.Writer instance that tar uses internally.
359
- */
360
- export function Extract(opts: ExtractOptions | string): ParseStream;
361
-
362
- export interface FileStat extends stream.Readable, Fields {
363
- header: HeaderProperties;
364
- startBlockSize: number;
365
- blockRemain: number;
366
- remain: number;
367
- meta: boolean;
368
- ignore: boolean;
369
- size: number;
370
- }
371
-
372
- export interface ReadEntry extends MiniPass, HeaderProperties {
373
- /** The extended metadata object provided to the constructor. */
374
- extended: any;
375
- /** The global extended metadata object provided to the constructor. */
376
- globalExtended: any;
377
- /** The number of bytes remaining to be written into the stream. */
378
- remain: number;
379
- /** The number of 512-byte blocks remaining to be written into the stream. */
380
- blockRemain: number;
381
- /** Whether this entry should be ignored. */
382
- ignore: boolean;
383
- /**
384
- * True if this represents metadata about the next entry, false if it
385
- * represents a filesystem object.
386
- */
387
- meta: boolean;
388
- }
389
-
390
- export interface CreateOptions {
391
- /**
392
- * A function that will get called with (code, message, data) for any
393
- * warnings encountered. (See "Warnings and Errors")
394
- */
395
- onwarn?(code: string, message: string, data: Buffer): void;
396
-
397
- /**
398
- * Treat warnings as crash-worthy errors. Default false.
399
- */
400
- strict?: boolean | undefined;
401
-
402
- /**
403
- * The current working directory for creating the archive. Defaults to process.cwd().
404
- */
405
- cwd?: string | undefined;
406
-
407
- /**
408
- * Alias for cwd.
409
- */
410
- C?: string | undefined;
411
-
412
- /**
413
- * Set to any truthy value to create a gzipped archive,
414
- * or an object with settings for zlib.Gzip()
415
- */
416
- gzip?: boolean | zlib.ZlibOptions | undefined;
417
-
418
- /**
419
- * Alias for gzip.
420
- */
421
- z?: boolean | zlib.ZlibOptions | undefined;
422
-
423
- /**
424
- * Set to any truthy value to create a brotli-compressed archive,
425
- * or an object with settings for zlib.BrotliCompress()
426
- */
427
- brotli?: boolean | zlib.BrotliOptions | undefined;
428
-
429
- /**
430
- * A function that gets called with (path, stat) for each entry being
431
- * added. Return true to add the entry to the archive, or false to omit it.
432
- */
433
- filter?(path: string, stat: fs.Stats): boolean;
434
-
435
- /**
436
- * Omit metadata that is system-specific: ctime, atime, uid, gid, uname,
437
- * gname, dev, ino, and nlink. Note that mtime is still included,
438
- * because this is necessary other time-based operations.
439
- */
440
- portable?: boolean | undefined;
441
-
442
- /**
443
- * Allow absolute paths. By default, / is stripped from absolute paths.
444
- */
445
- preservePaths?: boolean | undefined;
446
-
447
- /**
448
- * Alias for presevePaths.
449
- */
450
- P?: boolean | undefined;
451
-
452
- /**
453
- * The mode to set on the created file archive.
454
- */
455
- mode?: number | undefined;
456
-
457
- /**
458
- * Do not recursively archive the contents of directories.
459
- */
460
- noDirRecurse?: boolean | undefined;
461
-
462
- /**
463
- * Set to true to pack the targets of symbolic links. Without this
464
- * option, symbolic links are archived as such.
465
- */
466
- follow?: boolean | undefined;
467
-
468
- /**
469
- * Alias for follow.
470
- */
471
- L?: boolean | undefined;
472
-
473
- /**
474
- * Alias for follow.
475
- */
476
- h?: boolean | undefined;
477
-
478
- /**
479
- * Suppress pax extended headers. Note that this means that long paths and
480
- * linkpaths will be truncated, and large or negative numeric values
481
- * may be interpreted incorrectly.
482
- */
483
- noPax?: boolean | undefined;
484
-
485
- /**
486
- * Set to true to omit writing mtime values for entries. Note that this prevents using other mtime-based features
487
- * like `tar.update` or the `keepNewer` option with the resulting tar archive. [Alias: m, no-mtime]
488
- */
489
- noMtime?: boolean | undefined;
490
- m?: boolean | undefined;
491
- "no-mtime"?: boolean | undefined;
492
-
493
- /**
494
- * Set to a Date object to force a specific mtime for everything added to the archive. Overridden by noMtime.
495
- */
496
- mtime?: Date;
497
-
498
- /**
499
- * A path portion to prefix onto the entries in the archive.
500
- */
501
- prefix?: string | undefined;
502
- }
503
-
504
- export interface ExtractOptions {
505
- /**
506
- * A function that will get called with (code, message, data) for any
507
- * warnings encountered. (See "Warnings and Errors")
508
- */
509
- onwarn?(code: string, message: string, data: Buffer): void;
510
-
511
- /**
512
- * Treat warnings as crash-worthy errors. Default false.
513
- */
514
- strict?: boolean | undefined;
515
-
516
- /**
517
- * Extract files relative to the specified directory. Defaults to
518
- * process.cwd(). If provided, this must exist and must be a directory.
519
- */
520
- cwd?: string | undefined;
521
-
522
- /**
523
- * Alias for cwd.
524
- */
525
- C?: string | undefined;
526
-
527
- /**
528
- * A function that gets called with (path, stat) for each entry being
529
- * added. Return true to emit the entry from the archive, or false to skip it.
530
- */
531
- filter?(path: string, stat: FileStat): boolean;
532
-
533
- /**
534
- * Set to true to keep the existing file on disk if it's newer than
535
- * the file in the archive.
536
- */
537
- newer?: boolean | undefined;
538
-
539
- /**
540
- * Alias for newer.
541
- */
542
- "keep-newer"?: boolean | undefined;
543
-
544
- /**
545
- * Alias for newer.
546
- */
547
- "keep-newer-files"?: boolean | undefined;
548
-
549
- /**
550
- * Do not overwrite existing files. In particular, if a file appears more
551
- * than once in an archive, later copies will not overwrite earlier copies
552
- */
553
- keep?: boolean | undefined;
554
-
555
- /**
556
- * Alias for keep.
557
- */
558
- k?: boolean | undefined;
559
-
560
- /**
561
- * Alias for keep.
562
- */
563
- "keep-existing"?: boolean | undefined;
564
-
565
- /**
566
- * Allow absolute paths, paths containing .., and extracting
567
- * through symbolic links. By default, / is stripped from
568
- * absolute paths, .. paths are not extracted, and any file
569
- * whose location would be modified by a symbolic link is not
570
- * extracted.
571
- */
572
- preservePaths?: boolean | undefined;
573
-
574
- /**
575
- * Alias for presevePaths.
576
- */
577
- P?: boolean | undefined;
578
-
579
- /**
580
- * Unlink files before creating them. Without this option, tar overwrites
581
- * existing files, which preserves existing hardlinks. With this option,
582
- * existing hardlinks will be broken, as will any symlink that would
583
- * affect the location of an extracted file.
584
- */
585
- unlink?: boolean | undefined;
586
-
587
- /**
588
- * Remove the specified number of leading path elements. Pathnames with
589
- * fewer elements will be silently skipped. Note that the pathname
590
- * is edited after applying the filter, but before security checks.
591
- */
592
- strip?: number | undefined;
593
-
594
- /**
595
- * Alias for strip.
596
- */
597
- "strip-components"?: number | undefined;
598
-
599
- /**
600
- * Alias for strip.
601
- */
602
- stripComponents?: number | undefined;
603
-
604
- /**
605
- * If true, tar will set the uid and gid of extracted entries to the uid
606
- * and gid fields in the archive. This defaults to true when run as root,
607
- * and false otherwise. If false, then files and directories will be set
608
- * with the owner and group of the user running the process. This is
609
- * similar to -p in tar(1), but ACLs and other system-specific data is
610
- * never unpacked in this implementation, and modes
611
- * are set by default already.
612
- */
613
- preserveOwner?: boolean | undefined;
614
-
615
- /**
616
- * Alias for preserveOwner.
617
- */
618
- p?: boolean | undefined;
619
-
620
- /**
621
- * Set to a number to force ownership of all extracted files and folders,
622
- * and all implicitly created directories, to be owned by the specified
623
- * user id, regardless of the uid field in the archive. Cannot be used
624
- * along with preserveOwner. Requires also setting a gid option.
625
- */
626
- uid?: number | undefined;
627
-
628
- /**
629
- * Set to a number to force ownership of all extracted files and folders,
630
- * and all implicitly created directories, to be owned by the specified
631
- * group id, regardless of the gid field in the archive. Cannot be used
632
- * along with preserveOwner. Requires also setting a uid option
633
- */
634
- gid?: number | undefined;
635
-
636
- /**
637
- * Set to true to omit writing mtime value for extracted entries.
638
- * [Alias: m, no-mtime]
639
- */
640
- noMtime?: boolean | undefined;
641
- m?: boolean | undefined;
642
- "no-mtime"?: boolean | undefined;
643
-
644
- /**
645
- * Provide a function that takes an entry object, and returns a stream,
646
- * or any falsey value. If a stream is provided, then that stream's data
647
- * will be written instead of the contents of the archive entry. If a
648
- * falsey value is provided, then the entry is written to disk as normal.
649
- * (To exclude items from extraction, use the filter option described above.)
650
- */
651
- transform?(entry: ReadEntry): NodeJS.WritableStream | undefined | false | null;
652
-
653
- /**
654
- * A function that gets called with (entry) for each entry that passes the
655
- * filter.
656
- */
657
- onentry?(entry: ReadEntry): void;
658
-
659
- /**
660
- * Set to true to omit calling `fs.chmod()` to ensure that the extracted file
661
- * matches the entry mode. This also suppresses the call to `process.umask()`
662
- * to determine the default umask value, since tar will extract with whatever
663
- * mode is provided, and let the process `umask` apply normally.
664
- */
665
- noChmod?: boolean | undefined;
666
-
667
- // The following options are mostly internal, but can be modified in some
668
- // advanced use cases, such as re-using caches between runs.
669
-
670
- /**
671
- * The maximum buffer size for fs.read() operations (in bytes). Defaults to 16 MB.
672
- */
673
- maxReadSize?: number | undefined;
674
-
675
- /**
676
- * The maximum size of meta entries that is supported. Defaults to 1 MB.
677
- */
678
- maxMetaEntrySize?: number | undefined;
679
- }
680
-
681
- export interface ListOptions {
682
- /**
683
- * Treat warnings as crash-worthy errors. Default false.
684
- */
685
- strict?: boolean | undefined;
686
-
687
- /**
688
- * Extract files relative to the specified directory. Defaults to
689
- * process.cwd(). If provided, this must exist and must be a directory.
690
- */
691
- cwd?: string | undefined;
692
-
693
- /**
694
- * Alias for cwd.
695
- */
696
- C?: string | undefined;
697
-
698
- /**
699
- * A function that gets called with (path, stat) for each entry being
700
- * added. Return true to emit the entry from the archive, or false to skip it.
701
- */
702
- filter?(path: string, entry: FileStat): boolean;
703
-
704
- /**
705
- * A function that gets called with (entry) for each entry that passes the
706
- * filter. This is important for when both file and sync are set, because
707
- * it will be called synchronously.
708
- */
709
- onentry?(entry: ReadEntry): void;
710
-
711
- /**
712
- * The maximum buffer size for fs.read() operations. Defaults to 16 MB.
713
- */
714
- maxReadSize?: number | undefined;
715
-
716
- /**
717
- * By default, entry streams are resumed immediately after the call to
718
- * onentry. Set noResume: true to suppress this behavior. Note that by
719
- * opting into this, the stream will never complete until the entry
720
- * data is consumed.
721
- */
722
- noResume?: boolean | undefined;
723
- }
724
-
725
- export interface ReplaceOptions {
726
- /**
727
- * Required. Write the tarball archive to the specified filename.
728
- */
729
- file: string;
730
-
731
- /**
732
- * Act synchronously. If this is set, then any provided file will be
733
- * fully written after the call to tar.c.
734
- */
735
- sync?: boolean | undefined;
736
-
737
- /**
738
- * A function that will get called with (code, message, data) for any
739
- * warnings encountered. (See "Warnings and Errors")
740
- */
741
- onwarn?(code: string, message: string, data: Buffer): void;
742
-
743
- /**
744
- * Treat warnings as crash-worthy errors. Default false.
745
- */
746
- strict?: boolean | undefined;
747
-
748
- /**
749
- * Extract files relative to the specified directory. Defaults to
750
- * process.cwd(). If provided, this must exist and must be a directory.
751
- */
752
- cwd?: string | undefined;
753
-
754
- /**
755
- * Alias for cwd.
756
- */
757
- C?: string | undefined;
758
-
759
- /**
760
- * A path portion to prefix onto the entries in the archive.
761
- */
762
- prefix?: string | undefined;
763
-
764
- /**
765
- * A function that gets called with (path, stat) for each entry being
766
- * added. Return true to emit the entry from the archive, or false to skip it.
767
- */
768
- filter?(path: string, stat: fs.Stats): boolean;
769
-
770
- /**
771
- * Allow absolute paths. By default, / is stripped from absolute paths.
772
- */
773
- preservePaths?: boolean | undefined;
774
-
775
- /**
776
- * The maximum buffer size for fs.read() operations. Defaults to 16 MB.
777
- */
778
- maxReadSize?: number | undefined;
779
-
780
- /**
781
- * Do not recursively archive the contents of directories.
782
- */
783
- noDirRecurse?: boolean | undefined;
784
-
785
- /**
786
- * Set to true to pack the targets of symbolic links. Without this
787
- * option, symbolic links are archived as such.
788
- */
789
- follow?: boolean | undefined;
790
-
791
- /**
792
- * Alias for follow.
793
- */
794
- L?: boolean | undefined;
795
-
796
- /**
797
- * Alias for follow.
798
- */
799
- h?: boolean | undefined;
800
-
801
- /**
802
- * uppress pax extended headers. Note that this means that long paths and
803
- * linkpaths will be truncated, and large or negative numeric values
804
- * may be interpreted incorrectly.
805
- */
806
- noPax?: boolean | undefined;
807
- }
808
-
809
- export interface FileOptions {
810
- /**
811
- * Uses the given file as the input or output of this function.
812
- */
813
- file?: string | undefined;
814
-
815
- /**
816
- * Alias for file.
817
- */
818
- f?: string | undefined;
819
- }
820
-
821
- export type RequiredFileOptions =
822
- | {
823
- /**
824
- * Uses the given file as the input or output of this function.
825
- */
826
- file: string;
827
- }
828
- | {
829
- /**
830
- * Alias for file.
831
- */
832
- f: string;
833
- };
834
-
835
- /**
836
- * Create a tarball archive. The fileList is an array of paths to add to the
837
- * tarball. Adding a directory also adds its children recursively. An entry in
838
- * fileList that starts with an @ symbol is a tar archive whose entries will
839
- * be added. To add a file that starts with @, prepend it with `./`.
840
- *
841
- * Archive data may be read from the returned stream.
842
- */
843
- export function create(
844
- options: CreateOptions,
845
- fileList: readonly string[],
846
- callback?: (err?: Error) => void,
847
- ): stream.Readable;
848
-
849
- /**
850
- * Create a tarball archive. The fileList is an array of paths to add to the
851
- * tarball. Adding a directory also adds its children recursively. An entry in
852
- * fileList that starts with an @ symbol is a tar archive whose entries will
853
- * be added. To add a file that starts with @, prepend it with `./`.
854
- */
855
- export function create(options: CreateOptions & FileOptions, fileList: readonly string[]): Promise<void>;
856
- export function create(options: CreateOptions & FileOptions & { sync: true }, fileList: readonly string[]): void;
857
- export function create(
858
- options: CreateOptions & FileOptions,
859
- fileList: readonly string[],
860
- callback: (err?: Error) => void,
861
- ): void;
862
-
863
- /**
864
- * Alias for create
865
- */
866
- export const c: typeof create;
867
-
868
- /**
869
- * Extract a tarball archive. The fileList is an array of paths to extract
870
- * from the tarball. If no paths are provided, then all the entries are
871
- * extracted. If the archive is gzipped, then tar will detect this and unzip
872
- * it. Note that all directories that are created will be forced to be
873
- * writable, readable, and listable by their owner, to avoid cases where a
874
- * directory prevents extraction of child entries by virtue of its mode. Most
875
- * extraction errors will cause a warn event to be emitted. If the cwd is
876
- * missing, or not a directory, then the extraction will fail completely.
877
- *
878
- * Archive data should be written to the returned stream.
879
- */
880
- export function extract(
881
- options: ExtractOptions,
882
- fileList?: readonly string[],
883
- callback?: (err?: Error) => void,
884
- ): stream.Writable;
885
-
886
- /**
887
- * Extract a tarball archive. The fileList is an array of paths to extract
888
- * from the tarball. If no paths are provided, then all the entries are
889
- * extracted. If the archive is gzipped, then tar will detect this and unzip
890
- * it. Note that all directories that are created will be forced to be
891
- * writable, readable, and listable by their owner, to avoid cases where a
892
- * directory prevents extraction of child entries by virtue of its mode. Most
893
- * extraction errors will cause a warn event to be emitted. If the cwd is
894
- * missing, or not a directory, then the extraction will fail completely.
895
- */
896
- export function extract(options: ExtractOptions & FileOptions, fileList?: readonly string[]): Promise<void>;
897
- export function extract(options: ExtractOptions & FileOptions & { sync: true }, fileList?: readonly string[]): void;
898
- export function extract(
899
- options: ExtractOptions & FileOptions,
900
- fileList: readonly string[] | undefined,
901
- callback: (err?: Error) => void,
902
- ): void;
903
-
904
- /**
905
- * Alias for extract
906
- */
907
- export const x: typeof extract;
908
-
909
- /**
910
- * List the contents of a tarball archive. The fileList is an array of paths
911
- * to list from the tarball. If no paths are provided, then all the entries
912
- * are listed. If the archive is gzipped, then tar will detect this and unzip
913
- * it.
914
- */
915
- export function list(options: ListOptions & RequiredFileOptions, fileList?: readonly string[]): Promise<void>;
916
- export function list(options: ListOptions & RequiredFileOptions & { sync: true }, fileList?: readonly string[]): void;
917
- export function list(callback?: (err?: Error) => void): Parse;
918
- export function list(optionsOrFileList: ListOptions | readonly string[], callback?: (err?: Error) => void): Parse;
919
- export function list(options: ListOptions, fileList: readonly string[], callback?: (err?: Error) => void): Parse;
920
-
921
- /**
922
- * Alias for list
923
- */
924
- export const t: typeof list;
925
-
926
- /**
927
- * Add files to an existing archive. Because later entries override earlier
928
- * entries, this effectively replaces any existing entries. The fileList is an
929
- * array of paths to add to the tarball. Adding a directory also adds its
930
- * children recursively. An entry in fileList that starts with an @ symbol is
931
- * a tar archive whose entries will be added. To add a file that
932
- * starts with @, prepend it with ./.
933
- */
934
- export function replace(options: ReplaceOptions, fileList?: readonly string[]): Promise<void>;
935
- export function replace(
936
- options: ReplaceOptions,
937
- fileList: readonly string[] | undefined,
938
- callback: (err?: Error) => void,
939
- ): Promise<void>;
940
-
941
- /**
942
- * Alias for replace
943
- */
944
- export const r: typeof replace;
945
-
946
- /**
947
- * Add files to an archive if they are newer than the entry already in the
948
- * tarball archive. The fileList is an array of paths to add to the tarball.
949
- * Adding a directory also adds its children recursively. An entry in fileList
950
- * that starts with an @ symbol is a tar archive whose entries will be added.
951
- * To add a file that starts with @, prepend it with ./.
952
- */
953
- export function update(options: ReplaceOptions, fileList?: readonly string[]): Promise<void>;
954
- export function update(
955
- options: ReplaceOptions,
956
- fileList: readonly string[] | undefined,
957
- callback: (err?: Error) => void,
958
- ): Promise<void>;
959
-
960
- /**
961
- * Alias for update
962
- */
963
- export const u: typeof update;
964
-
965
- export {};