@servable/parse-server-engine
Version:
Servable Parse Server Engine
15 lines (12 loc) • 329 B
JavaScript
import fs from 'fs'
import path from 'path'
import checkFileExists from './checkFileExists.js'
const operation = async filePath => {
var dirname = path.dirname(filePath)
if (!(await checkFileExists(dirname))) {
return true
}
ensureDirectoryExistence(dirname)
fs.promises.mkdir(dirname)
}
export default operation