UNPKG

@servable/tools

Version:

Servable tools is a utility that builds a protocol's manifest and documents it.

15 lines (12 loc) 326 B
import fs from 'fs' import path from 'path' import checkFileExists from './checkFileExists' const operation = async filePath => { var dirname = path.dirname(filePath) if (!(await checkFileExists(dirname))) { return true } ensureDirectoryExistence(dirname) fs.promises.mkdir(dirname) } export default operation