How to use the mkdir function from fs-promise
Find comprehensive JavaScript fs-promise.mkdir code examples handpicked from public code repositorys.
53 54 55 56 57 58 59 60 61 62
* */ async createUploadDirectory() { const directoryExists = await fs.exists(this.uploadDir); if (!directoryExists) { await fs.mkdir(this.uploadDir); } } /**
20
26
0
GitHub: salil-gtm/SyndiShare
118 119 120 121 122 123 124 125 126 127
const archiveDir = path.dirname(archivePath); const promise = Q.resolve(mkdirp(archiveDir)) .then(() => checksum (fileHash) (filePath)) .then(() => filePath) .catch(() => fsp.exists(archiveDir) .then(exists => !exists ? fsp.mkdir(archiveDir) : null) .then(() => download (url)(archivePath).onData(promise.onDataCallback)) .then(() => hash("md5")(archivePath)) .then(() => archiveHash ? checksum(archiveHash)(archivePath) : null) .then(() => extract (archivePath) (archiveDir))
7
12
0
GitHub: salil-gtm/SyndiShare
163 164 165 166 167 168 169 170 171 172
return checksum(fileHash)(filePath); }).then(function () { return filePath; }).catch(function () { return fsp.exists(archiveDir).then(function (exists) { return !exists ? fsp.mkdir(archiveDir) : null; }).then(function () { return download(url)(archivePath).onData(promise.onDataCallback); }).then(function () { return hash("md5")(archivePath);
7
12
0
fs-promise.writeJson is the most popular function in fs-promise (6458 examples)