serverless/lib/utils/fs/get-tmp-dir-path.js
Austen 158f644cd0
feat: Refactor logging to reduce complexity (#12432)
* chore: Change logger

* chore: continue refactor

* chore: WIP

* chore: Sync
2024-04-17 13:26:31 -07:00

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;