@vltpkg/tar 1.0.4 → 1.0.5
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 +3 -2
- package/dist/pool.d.ts +6 -4
- package/dist/pool.js +8 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -61,8 +61,9 @@ Queue of requests awaiting an available worker.
|
|
|
61
61
|
|
|
62
62
|
#### `pool.pending`
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
All unpack requests that have not yet completed, both those currently
|
|
65
|
+
assigned to a worker and those still waiting in the queue. Entries are
|
|
66
|
+
removed once the request resolves or rejects.
|
|
66
67
|
|
|
67
68
|
#### `pool.unpack(tarData: Buffer, target: string) => Promise<void>`
|
|
68
69
|
|
package/dist/pool.d.ts
CHANGED
|
@@ -12,8 +12,8 @@ export * from './worker.ts';
|
|
|
12
12
|
export declare class Pool {
|
|
13
13
|
#private;
|
|
14
14
|
/**
|
|
15
|
-
* Number of workers to
|
|
16
|
-
* CPUs,
|
|
15
|
+
* Number of workers to employ. Defaults to 8 times one less than
|
|
16
|
+
* the number of available CPUs, with a minimum of 8.
|
|
17
17
|
*/
|
|
18
18
|
jobs: number;
|
|
19
19
|
/**
|
|
@@ -25,8 +25,10 @@ export declare class Pool {
|
|
|
25
25
|
*/
|
|
26
26
|
queue: UnpackRequest[];
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
28
|
+
* All requests that have not yet been confirmed completed, both
|
|
29
|
+
* those currently assigned to a worker and those still waiting in
|
|
30
|
+
* the queue. Entries are removed once the request resolves or
|
|
31
|
+
* rejects, releasing the reference to its tarball buffer.
|
|
30
32
|
*/
|
|
31
33
|
pending: Map<number, UnpackRequest>;
|
|
32
34
|
/**
|
package/dist/pool.js
CHANGED
|
@@ -14,8 +14,8 @@ export * from "./worker.js";
|
|
|
14
14
|
*/
|
|
15
15
|
export class Pool {
|
|
16
16
|
/**
|
|
17
|
-
* Number of workers to
|
|
18
|
-
* CPUs,
|
|
17
|
+
* Number of workers to employ. Defaults to 8 times one less than
|
|
18
|
+
* the number of available CPUs, with a minimum of 8.
|
|
19
19
|
*/
|
|
20
20
|
/* c8 ignore next */
|
|
21
21
|
jobs = 8 * (Math.max(os.availableParallelism(), 2) - 1);
|
|
@@ -28,8 +28,10 @@ export class Pool {
|
|
|
28
28
|
*/
|
|
29
29
|
queue = [];
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
31
|
+
* All requests that have not yet been confirmed completed, both
|
|
32
|
+
* those currently assigned to a worker and those still waiting in
|
|
33
|
+
* the queue. Entries are removed once the request resolves or
|
|
34
|
+
* rejects, releasing the reference to its tarball buffer.
|
|
33
35
|
*/
|
|
34
36
|
pending = new Map();
|
|
35
37
|
// handle a message from the worker
|
|
@@ -41,6 +43,8 @@ export class Pool {
|
|
|
41
43
|
/* c8 ignore next */
|
|
42
44
|
if (!ur)
|
|
43
45
|
return;
|
|
46
|
+
// request is done, stop holding its tarball buffer in memory
|
|
47
|
+
this.pending.delete(id);
|
|
44
48
|
if (isResponseOK(m)) {
|
|
45
49
|
ur.resolve();
|
|
46
50
|
/* c8 ignore start - nearly impossible in normal circumstances */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vltpkg/tar",
|
|
3
3
|
"description": "An extremely limited and very fast tar extractor",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.5",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/vltpkg/vltpkg.git",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"url": "http://vlt.sh"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@vltpkg/error-cause": "1.0.
|
|
17
|
-
"@vltpkg/types": "1.0.
|
|
16
|
+
"@vltpkg/error-cause": "1.0.5",
|
|
17
|
+
"@vltpkg/types": "1.0.5",
|
|
18
18
|
"rimraf": "^6.1.2",
|
|
19
19
|
"tar": "^7.5.2"
|
|
20
20
|
},
|