本文整理汇总了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()))