Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tempy

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tempy - npm Package Compare versions

Comparing version 0.7.1 to 1.0.0

8

index.d.ts

@@ -42,3 +42,3 @@ /// <reference types="node"/>

*/
type TaskCallback = (tempPath: string) => Promise<void> | void;
type TaskCallback<ReturnValueType> = (tempPath: string) => Promise<ReturnValueType> | ReturnValueType;
}

@@ -63,3 +63,3 @@

*/
task: (callback: tempy.TaskCallback, options?: tempy.FileOptions) => Promise<void>;
task: <ReturnValueType>(callback: tempy.TaskCallback<ReturnValueType>, options?: tempy.FileOptions) => Promise<ReturnValueType>;

@@ -104,3 +104,3 @@ /**

*/
task: (callback: tempy.TaskCallback, options?: tempy.DirectoryOptions) => Promise<void>;
task: <ReturnValueType>(callback: tempy.TaskCallback<ReturnValueType>, options?: tempy.DirectoryOptions) => Promise<ReturnValueType>;

@@ -139,3 +139,3 @@ /**

*/
task: (fileContent: string | Buffer | TypedArray | DataView | NodeJS.ReadableStream, callback: tempy.TaskCallback, options?: tempy.FileOptions) => Promise<void>;
task: <ReturnValueType>(fileContent: string | Buffer | TypedArray | DataView | NodeJS.ReadableStream, callback: tempy.TaskCallback<ReturnValueType>, options?: tempy.FileOptions) => Promise<ReturnValueType>;

@@ -142,0 +142,0 @@ /**

@@ -21,4 +21,5 @@ 'use strict';

const result = await tempyFunction(...arguments_.slice(0, extraArguments), options);
await callback(result);
const returnValue = await callback(result);
await del(result, {force: true});
return returnValue;
};

@@ -25,0 +26,0 @@

{
"name": "tempy",
"version": "0.7.1",
"version": "1.0.0",
"description": "Get a random temporary file or directory path",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -40,3 +40,3 @@ # tempy [![Build Status](https://travis-ci.com/sindresorhus/tempy.svg?branch=master)](https://travis-ci.com/github/sindresorhus/tempy)

The `callback` resolves with a temporary file path you can write to. The file is automatically cleaned up after the callback is executed. Returns a promise that resolves after the callback is executed and the file is cleaned up.
The `callback` resolves with a temporary file path you can write to. The file is automatically cleaned up after the callback is executed. Returns a promise that resolves with the return value of the callback after it is executed and the file is cleaned up.

@@ -73,3 +73,3 @@ #### callback

The `callback` resolves with a temporary directory path you can write to. The directory is automatically cleaned up after the callback is executed. Returns a promise that resolves after the callback is executed and the directory is cleaned up.
The `callback` resolves with a temporary directory path you can write to. The directory is automatically cleaned up after the callback is executed. Returns a promise that resolves with the return value of the callback after it is executed and the directory is cleaned up.

@@ -102,3 +102,3 @@ ##### callback

Write data to a random temp file. The file is automatically cleaned up after the callback is executed. Returns a promise that resolves after the callback is executed and the file is cleaned up.
Write data to a random temp file. The file is automatically cleaned up after the callback is executed. Returns a promise that resolves with the return value of the callback after it is executed and the file is cleaned up.

@@ -105,0 +105,0 @@ ##### fileContent

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