mirror of
https://github.com/sasjs/server.git
synced 2026-07-24 13:42:14 +00:00
chore: restructure repo into sub folders
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
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('')
|
||||
Reference in New Issue
Block a user