Skip to content

Commit 65ffa6d

Browse files
committed
Removed need for tmp dependency
1 parent bd945f0 commit 65ffa6d

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535
},
3636
"dependencies": {
3737
"readline-sync": "^1.4.9",
38-
"sprintf-js": "^1.1.2",
39-
"tmp": "^0.0.33"
38+
"sprintf-js": "^1.1.2"
4039
},
4140
"sideEffects": false,
4241
"eslintConfig": {

src/loslib.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,9 @@ if (typeof process === "undefined") {
484484
};
485485
} else {
486486
/* Only with Node */
487+
const os = require('os');
487488
const fs = require('fs');
488-
const tmp = require('tmp');
489+
const path = require('path');
489490
const child_process = require('child_process');
490491

491492
syslib.exit = function(L) {
@@ -517,7 +518,7 @@ if (typeof process === "undefined") {
517518
};
518519

519520
const lua_tmpname = function() {
520-
return tmp.tmpNameSync();
521+
return path.join(os.tmpdir(), 'tmp-' + Math.random().toString(36).slice(2));
521522
};
522523

523524
syslib.remove = function(L) {

0 commit comments

Comments
 (0)