🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.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

Get a random temporary file or directory path

3.1.0
latest
Source
npm
Version published
Weekly downloads
10M
7.21%
Maintainers
1
Weekly downloads
 
Created

What is tempy?

Tempy is a utility package for creating temporary files and directories. It provides a simple API to generate temporary paths, files, and directories that are automatically cleaned up when no longer needed.

What are tempy's main functionalities?

Create a temporary file

This feature allows you to create a temporary file. The `tempy.file()` method generates a unique file path in the system's temporary directory.

const tempy = require('tempy');
const tempFilePath = tempy.file();
console.log(tempFilePath);

Create a temporary directory

This feature allows you to create a temporary directory. The `tempy.directory()` method generates a unique directory path in the system's temporary directory.

const tempy = require('tempy');
const tempDirPath = tempy.directory();
console.log(tempDirPath);

Create a temporary file with a specific extension

This feature allows you to create a temporary file with a specific extension. The `tempy.file({ extension: 'txt' })` method generates a unique file path with the specified extension in the system's temporary directory.

const tempy = require('tempy');
const tempFilePath = tempy.file({ extension: 'txt' });
console.log(tempFilePath);

Create a temporary directory with a specific name

This feature allows you to create a temporary directory with a specific name. The `tempy.directory({ name: 'my-temp-dir' })` method generates a unique directory path with the specified name in the system's temporary directory.

const tempy = require('tempy');
const tempDirPath = tempy.directory({ name: 'my-temp-dir' });
console.log(tempDirPath);

Other packages similar to tempy

Keywords

temp

FAQs

Package last updated on 10 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts