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