UNPKG
delta-file-multer
Version:
latest (1.0.1)
1.0.1
1.0.0
A simple plug-n-play file upload middleware using Multer and MongoDB
delta-file-multer
/
utils
/
ensureDir.js
9 lines
(7 loc)
•
189 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
import
fs
from
"fs"
;
import
path
from
"path"
;
export
const
ensureDirExists
= (
dirPath
) => {
if
(!fs.
existsSync
(dirPath)) { fs.
mkdirSync
(dirPath, {
recursive
:
true
}); } };