mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
16 lines
332 B
JavaScript
16 lines
332 B
JavaScript
import os from 'os';
|
|
import path from 'path';
|
|
import crypto from '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'));
|
|
}
|
|
|
|
export default getTmpDirPath;
|