package
Provides a uniquely named temp directory.
npm install unique-temp-dirGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 4 packages.
112.7 kB
Includes dependencies.
Provides a uniquely named temp directory.
$ npm install --save unique-temp-dirconst uniqueTempDir = require('unique-temp-dir');
uniqueTempDir();
//=> '/var/folders/2_/zg9h6_xd4r3_z7c07s0cn8mw0000gn/T/PpCfz55ANU2hdwnGzgny'
uniqueTempDir();
//=> '/var/folders/2_/zg9h6_xd4r3_z7c07s0cn8mw0000gn/T/qfqafhh1FJulehbCDAPk'Returns a string that represents a unique directory inside the systems temp directory.
Type: boolean
Default: false
If true, the directory will be created synchronously before returning.
Type: number
Default: 20
The length of the directory name inside the temp directory.
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/barMIT © James Talmage