mirror of
https://github.com/serverless/serverless.git
synced 2025-12-08 19:46:03 +00:00
18 lines
364 B
JavaScript
18 lines
364 B
JavaScript
'use strict';
|
|
|
|
const os = require('os');
|
|
const path = require('path');
|
|
const crypto = require('crypto');
|
|
|
|
const tmpDirCommonPath = path.join(
|
|
os.tmpdir(),
|
|
'tmpdirs-serverless',
|
|
crypto.randomBytes(2).toString('hex')
|
|
);
|
|
|
|
function getTmpDirPath() {
|
|
return path.join(tmpDirCommonPath, crypto.randomBytes(8).toString('hex'));
|
|
}
|
|
|
|
module.exports = getTmpDirPath;
|