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 1.0.2 to 2.0.0

6

out/main.d.ts
export declare function getTempName(prefix?: string | null | undefined): string;
export interface GetTempFileOptions {
disposer: ((file: string) => Promise<void>) | null;
prefix?: string | null;
}
export declare class TmpDir {

@@ -7,5 +11,5 @@ private tempFiles;

createTempDir(suffix?: string): Promise<string>;
getTempFile(suffix: string, isDir?: boolean, disposer?: ((file: string) => Promise<void>) | null): Promise<string>;
getTempFile(suffix: string | null, isDir?: boolean, options?: GetTempFileOptions): Promise<string>;
cleanupSync(): void;
cleanup(): Promise<any>;
}

12

out/main.js

@@ -105,3 +105,3 @@ "use strict";

let isDir = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
let disposer = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
let options = arguments[2];

@@ -113,4 +113,10 @@ return tempDir.value.then(it => {

}
const result = `${it}${_path.sep}${(tmpFileCounter++).toString(16)}${suffix.length === 0 || suffix.startsWith(".") ? suffix : `-${suffix}`}`;
this.tempFiles.push({ path: result, isDir, disposer });
const namePrefix = options == null || options.prefix == null ? "" : options.prefix;
const nameSuffix = suffix == null || suffix.length === 0 ? "" : suffix.startsWith(".") ? suffix : `-${suffix}`;
const result = `${it}${_path.sep}${namePrefix}${(tmpFileCounter++).toString(16)}${nameSuffix}`;
this.tempFiles.push({
path: result,
isDir,
disposer: options == null ? null : options.disposer
});
return result;

@@ -117,0 +123,0 @@ });

{
"name": "temp-file",
"version": "1.0.2",
"version": "2.0.0",
"main": "out/main.js",

@@ -24,6 +24,6 @@ "author": "Vladimir Krivosheev",

"devDependencies": {
"@types/js-yaml": "^3.9.0",
"@types/node": "^8.0.20",
"@types/js-yaml": "^3.9.1",
"@types/node": "^8.0.24",
"babel-preset-ts-node4-bluebird": "^0.1.0",
"ts-babel": "^3.2.1",
"ts-babel": "^4.0.1",
"typescript": "^2.4.2"

@@ -30,0 +30,0 @@ },

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