mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-14 09:52:09 +03:00
24 lines
328 B
JavaScript
24 lines
328 B
JavaScript
|
/**
|
||
|
* Dependencies
|
||
|
*/
|
||
|
|
||
|
var join = require('path').join,
|
||
|
|
||
|
TMP_DIR = require('os').tmpdir();
|
||
|
|
||
|
/**
|
||
|
* Generate a temporary file path
|
||
|
*/
|
||
|
|
||
|
function tempfile() {
|
||
|
var randomString = Math.random().toString(36).substring(7);
|
||
|
|
||
|
return join(TMP_DIR, randomString);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Expose `tempfile`
|
||
|
*/
|
||
|
|
||
|
module.exports = tempfile;
|