Socket
Socket
Sign inDemoInstall

temp-file

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

temp-file - npm Package Compare versions

Comparing version 3.2.0 to 3.3.0

21

out/main.js

@@ -65,18 +65,5 @@ "use strict";

const tempDir = new (_lazyVal().Lazy)(() => {
let promise;
const systemTmpDir = process.env.TEST_TMP_DIR || process.env.ELECTRON_BUILDER_TMP_DIR || process.env.ELECTRON_BUILDER_TEST_DIR || (0, _os().tmpdir)();
const systemTmpDir = process.env.APP_BUILDER_TMP_DIR || (0, _os().tmpdir)();
const isEnsureRemovedOnExit = process.env.TMP_DIR_MANAGER_ENSURE_REMOVED_ON_EXIT !== "false";
if (!isEnsureRemovedOnExit) {
promise = Promise.resolve(systemTmpDir);
} else if (_fsExtraP().mkdtemp == null) {
const dir = path.join(systemTmpDir, getTempName("temp-files"));
promise = (0, _fsExtraP().ensureDir)(dir, {
mode: 448
}).then(() => dir);
} else {
promise = (0, _fsExtraP().mkdtemp)(`${path.join(systemTmpDir, "temp-dir")}-`);
}
return promise.then(it => (0, _fsExtraP().realpath)(it)).then(dir => {
return (0, _fsExtraP().mkdtemp)(`${path.join(systemTmpDir, "t-")}-`).then(it => (0, _fsExtraP().realpath)(it)).then(dir => {
if (isEnsureRemovedOnExit) {

@@ -149,3 +136,3 @@ addExitHook(dir);

getTempFile(options, isDir = false) {
return tempDir.value.then(it => {
return tempDir.value.then(baseTempDir => {
if (!this.registered) {

@@ -160,3 +147,3 @@ this.registered = true;

const nameSuffix = suffix == null ? "" : suffix.startsWith(".") ? suffix : `-${suffix}`;
const result = `${it}${path.sep}${namePrefix}${(tmpFileCounter++).toString(36)}${nameSuffix}`;
const result = `${baseTempDir}${path.sep}${namePrefix}${(tmpFileCounter++).toString(36)}${nameSuffix}`;
this.tempFiles.push({

@@ -163,0 +150,0 @@ path: result,

6

package.json
{
"name": "temp-file",
"version": "3.2.0",
"version": "3.3.0",
"main": "out/main.js",

@@ -15,3 +15,3 @@ "author": "Vladimir Krivosheev",

"compile": "ts-babel",
"release": "yarn compile && npm publish"
"release": "BABEL_ENV=production yarn compile && npm publish"
},

@@ -26,3 +26,3 @@ "dependencies": {

"@types/js-yaml": "^3.11.2",
"@types/node": "^10.12.2",
"@types/node": "^10.12.9",
"babel-preset-ts-node6-bluebird": "^3.0.1",

@@ -29,0 +29,0 @@ "ts-babel": "^6.1.2",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc