Skip to content

Commit fe008bf

Browse files
committed
chore: use tmp instead of tempy
1 parent 7d85ce9 commit fe008bf

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

lib/deps.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const { Arborist } = require('@npmcli/arborist');
44
const Fs = require('fs');
55
const Path = require('path');
6-
const Tempy = require('tempy');
6+
const Tmp = require('tmp');
77

88
const Package = require('./package');
99

@@ -25,7 +25,9 @@ exports.resolve = async ({ packageJson, lockfile }, options) => {
2525

2626
const { deep, dev } = options;
2727

28-
const path = Tempy.directory();
28+
const tmpDir = Tmp.dirSync({ unsafeCleanup: true });
29+
const path = tmpDir.name;
30+
2931
Fs.writeFileSync(Path.join(path, 'package.json'), JSON.stringify(packageJson, null, ' '));
3032

3133
if (lockfile) {
@@ -80,6 +82,8 @@ exports.resolve = async ({ packageJson, lockfile }, options) => {
8082
result[name] = [...map[name]];
8183
}
8284

85+
tmpDir.removeCallback();
86+
8387
return result;
8488
};
8589

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
"@hapi/lab": "^22.0.0",
3333
"allow-scripts": "^1.5.2",
3434
"nock": "^12.0.1",
35-
"sinon": "^9.0.0",
36-
"tmp": "^0.1.0"
35+
"sinon": "^9.0.0"
3736
},
3837
"dependencies": {
3938
"@hapi/wreck": "^17.0.0",
@@ -44,6 +43,6 @@
4443
"minimist": "^1.2.5",
4544
"pacote": "^11.1.0",
4645
"simple-git": "^1.131.0",
47-
"tempy": "^0.5.0"
46+
"tmp": "^0.1.0"
4847
}
4948
}

0 commit comments

Comments
 (0)