Hugging Face
Models
Datasets
Spaces
Posts
Docs
Solutions
Pricing
Log In
Sign Up
Spaces:
jbilcke-hf
/
community
like
0
Runtime error
App
Files
Files
Community
2cb5570
community
/
src
/
utils
/
createDirIfNeeded.mts
jbilcke-hf
HF staff
initial commit
b2d7d99
about 1 year ago
raw
Copy download link
history
blame
Safe
184 Bytes
import
{ existsSync, mkdirSync }
from
"node:fs"
export
const
createDirIfNeeded
= (
dirPath:
string
) => {
if
(!
existsSync
(dirPath)) {
mkdirSync
(dirPath, {
recursive
:
true
})
}
}