Socket
Socket
Sign inDemoInstall

tempfile

Package Overview
Dependencies
1
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    tempfile

Get a random temporary file path


Version published
Weekly downloads
1.5M
increased by2%
Maintainers
1
Install size
7.05 kB
Created
Weekly downloads
 

Readme

Source

tempfile

Get a random temporary file path

Checkout out tempy which is a better take on this module.

Install

npm install tempfile

Usage

import tempfile from 'tempfile';

tempfile();
//=> '/var/folders/3x/jf5977fn79jbglr7rk0tq4d00000gn/T/6271e235-13b9-4138-8b9b-ee2f26c09ce3'

API

tempfile(options?)

options

Type: object

extension

Type: string

A file extension to append to the path.

import tempfile from 'tempfile';

tempfile();
//=> '/var/folders/3x/jf5977fn79jbglr7rk0tq4d00000gn/T/6271e235-13b9-4138-8b9b-ee2f26c09ce3'

tempfile({extension: 'png'});
//=> '/var/folders/3x/jf5977fn79jbglr7rk0tq4d00000gn/T/4049f192-43e7-43b2-98d9-094e6760861b.png'
  • tempy - Get a random temporary file or directory path
  • temp-write - Write string/buffer/stream to a random temp file

Keywords

FAQs

Last updated on 12 Feb 2023

Did you know?

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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc