mirror of
https://github.com/sasjs/server.git
synced 2026-01-03 21:10:05 +00:00
27 lines
730 B
TypeScript
27 lines
730 B
TypeScript
import path from 'path'
|
|
import { getRealPath, generateTimestamp } from '@sasjs/utils'
|
|
|
|
export const getTmpFolderPath = () =>
|
|
getRealPath(path.join(__dirname, '..', '..', 'tmp'))
|
|
|
|
export const getTmpFilesFolderPath = () =>
|
|
path.join(getTmpFolderPath(), 'files')
|
|
|
|
export const getTmpLogFolderPath = () => path.join(getTmpFolderPath(), 'logs')
|
|
|
|
export const getTmpWeboutFolderPath = () =>
|
|
path.join(getTmpFolderPath(), 'webouts')
|
|
|
|
export const getTmpSessionsFolderPath = () =>
|
|
path.join(getTmpFolderPath(), 'sessions')
|
|
|
|
export const generateUniqueFileName = (fileName: string, extension = '') =>
|
|
[
|
|
fileName,
|
|
'-',
|
|
Math.round(Math.random() * 100000),
|
|
'-',
|
|
new Date().getTime(),
|
|
extension
|
|
].join('')
|