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

unique-temp-dir

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unique-temp-dir

Provides a uniquely named temp directory.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
93K
decreased by-35.83%
Maintainers
1
Weekly downloads
 
Created
Source

unique-temp-dir Build Status

Provides a uniquely named temp directory.

Install

$ npm install --save unique-temp-dir

Usage

const uniqueTempDir = require('unique-temp-dir');

uniqueTempDir();
//=> '/var/folders/2_/zg9h6_xd4r3_z7c07s0cn8mw0000gn/T/PpCfz55ANU2hdwnGzgny'

uniqueTempDir();
//=> '/var/folders/2_/zg9h6_xd4r3_z7c07s0cn8mw0000gn/T/qfqafhh1FJulehbCDAPk'

API

uniqueTempDir([options])

Returns a string that represents a unique directory inside the systems temp directory.

options
create

Type: boolean
Default: false

If true, the directory will be created synchronously before returning.

length

Type: number
Default: 20

The length of the directory name inside the temp directory.

thunk

Type: boolean
Default: false

If true, returns a thunk function for path.join(uniqueTempDir, ... additionalArgs). Useful for filling your directory up with stuff.

const uniqueTempDir = require('unique-temp-dir');
const tempDir = uniqueTempDir({thunk: true});

tempDir()
//=> /user/temp/uniqueId

tempDir('foo')
//=> /user/temp/uniqueId/foo

tempDir('bar')
//=> /user/temp/uniqueId/bar

License

MIT © James Talmage

Keywords

FAQs

Package last updated on 30 Dec 2015

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

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