campose-api / src /utils /createDirIfNeeded.mts
jbilcke-hf's picture
jbilcke-hf HF staff
initial commit
5b3c62d
raw
history blame
184 Bytes
import { existsSync, mkdirSync } from "node:fs"
export const createDirIfNeeded = (dirPath: string) => {
if (!existsSync(dirPath)) {
mkdirSync(dirPath, { recursive: true })
}
}