本文整理匯總了TypeScript中fs.mkdir函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript mkdir函數的具體用法?TypeScript mkdir怎麽用?TypeScript mkdir使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了mkdir函數的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: mkdir
callb => mkdir(tmp_root, callb),
示例2: reject
await new Promise<void>((resolve, reject) => {
Fs.mkdir(subdirPath, e => (e ? reject(e) : resolve()))
})
示例3: Promise
return new Promise((resolve, reject) => {
fs.mkdir(this.path, mode, err => {
if (err && err.code === 'EEXIST') return resolve();
err ? reject(err) : resolve();
});
});
示例4: ensureDirectoryExists
return ensureDirectoryExists(basePath, () => fs.mkdir(directoryPath, action));
示例5: mkdirs
mkdirs(path.dirname(dirpath), mode, function () {
fs.mkdir(dirpath, mode, callback);
});
示例6:
async.retry(10, (cb: ErrorCallback) => {
let folderName = "superpowers-temp-";
for (let i = 0; i < 16; i++) folderName += getRandomTmpCharacter();
tempFolderPath = `${tmpRoot}/${folderName}`;
fs.mkdir(tempFolderPath, cb);
}, (err) => {
示例7: Promise
const makeDir = () => new Promise((resolve, reject) => {
fs.mkdir(targetPath, err => err ? reject(err) : resolve())
}).then(() => {}, (err: NodeJS.ErrnoException) => {
示例8: Promise
new Promise(resolve => {
fs.mkdir(name, () => {
log.info('create', name);
return resolve();
});
})
示例9: Promise
return new Promise((r, j) => fs.mkdir(path, (err) => err ? j(err) : r()))