fs#mkdir TypeScript Examples
The following examples show how to use
fs#mkdir.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FilesystemChecker.ts From Bridge with GNU General Public License v3.0 | 6 votes |
/**
* Attempts to create a unique folder in Bridge's data paths.
*/
private async createDownloadFolder(retryCount = 0) {
const tempChartPath = join(tempPath, `chart_${(await randomBytes(5)).toString('hex')}`)
mkdir(tempChartPath, this.cancelable((err) => {
if (err) {
if (retryCount < 5) {
devLog(`Error creating folder [${tempChartPath}], retrying with a different folder...`)
this.createDownloadFolder(retryCount + 1)
} else {
this.callbacks.error(filesystemErrors.mkdirError(err), () => this.createDownloadFolder())
}
} else {
this.callbacks.complete(tempChartPath)
}
}))
}
Example #2
Source File: Generator.ts From graphql-ts-client with MIT License | 5 votes |
mkdirAsync = promisify(mkdir)
Example #3
Source File: prepareAppFolder.ts From engine with MIT License | 5 votes |
pMkdir = promisify(mkdir)