How to use the mkdirsAsync function from fs-extra
Find comprehensive JavaScript fs-extra.mkdirsAsync code examples handpicked from public code repositorys.
188 189 190 191 192 193 194 195 196 197
let prepTasks = []; // Create a new destination directory. prepTasks.push( fs.mkdirsAsync(this.options.destination).then(() => { // Optionally, copy the contents of the builder's "kss-assets" folder. return fs.copyAsync( path.join(this.options.builder, 'kss-assets'), path.join(this.options.destination, 'kss-assets'),
293
1
2
142 143 144 145 146 147 148 149 150 151
let initTasks = []; // Create a new destination directory. initTasks.push( fs.mkdirsAsync(this.config.destination).then(() => { // Optionally, copy the contents of the builder's "kss-assets" folder. return fs.copyAsync( path.join(this.config.builder, 'kss-assets'), path.join(this.config.destination, 'kss-assets'),
293
0
2
GitHub: jjpps/Championify
30 31 32 33 34 35 36 37 38 39
const stat = new fs.Stats(); stat.mode = _modeFromEntry(entry); stat.mtime = _mtimeFromEntry(entry); if (stat.isDirectory()) { return fs.mkdirsAsync(path.join(dest, entry.fileName)); } else if (stat.isFile()) { return new Promise((resolve, reject) => { zip.openReadStream(entry, function(err, readStream) { if (err) return reject(err);
169
0
2
210 211 212 213 214 215 216 217 218 219
.then(() => this) .catch((e: Error) => logger.warn(e.message || e)); } saveDataFileAsync() { return fs.mkdirsAsync(this._pluginConfig.path) .then(() => this._saveDataFile(fs.writeFileAsync)); } saveDataFileSync() {
38
4
4
127 128 129 130 131 132 133 134 135 136
.each(data => { const itemset_data = JSON.stringify(data.riot_json, null, 4); const folder_path = path.join(store.get('itemset_path'), data.champ, 'Recommended'); const file_path = path.join(folder_path, `CIFY_${data.champ}_${data.source}_${data.file_prefix}.json`); return fs.mkdirsAsync(folder_path) .catch(err => Log.warn(err)) .then(() => fs.writeFileAsync(file_path, itemset_data, 'utf8')) .catch(err => { throw new ChampionifyErrors.FileWriteError('Failed to write item set json file').causedBy(err);
169
0
2
24 25 26 27 28 29 30 31 32 33
}) .then(function() { // Create temp build directory if it doesn't already exist return fs.mkdirsAsync(options.buildDir); }) .then(function() { installDir = path.join(options.installBaseDir, options.productID);
94
63
33
91 92 93 94 95 96 97 98 99 100
// copy generated handler so we can build directly from the source directory const generatedHandler = path.join(webpackConfig.context, handlerFileName); return fs.copyAsync(path.join(pathDist, handlerFileName), generatedHandler) .then(() => fs.mkdirsAsync(optimizedModulesPath)) .then(() => runWebpack(webpackConfig)) .then((stats) => { logStats(stats); const externals = getExternalsFromStats(stats);
28
68
12
+ 3 other calls in file
87 88 89 90 91 92 93 94 95 96
if (top === null) { this.running = false return Promise.resolve() } return fse.mkdirsAsync(loc.chapterPath(this.path, top.mangaName, top.chapterNum)) .then(() => this.isDownloadedImage(top.mangaName, top.chapterNum, top.url)) .then((downloaded) => { if (!downloaded) { return this.downloadImage(top.mangaName, top.chapterNum, top.url, top.type)
2
12
5
GitHub: linnovate/replay-infra
42 43 44 45 46 47 48 49 50 51
messageToSend.videoName = nameBuilder(startTime, SOURCE_ID); var fileName = messageToSend.videoName + '.ts'; messageToSend.transactionId = new mongoose.Types.ObjectId(); messageToSend.startTime = startTime; messageToSend.endTime = endTime; fs.mkdirsAsync(fullPath) .then(function() { return fs.copyAsync(HARDCODED_FILE_PATH, path.join(fullPath, fileName)); }) .then(function() {
10
7
26
75 76 77 78 79 80 81 82 83 84
function findLocaleFiles() { return BPromise.promisify(glob)('**/*.yml', { cwd: localesDir }); } function ensureGeneratedLocalesDirectory() { return fs.mkdirsAsync(generatedLocalesDir); } function readLocaleFile(file) { return fs.readFileAsync(file, { encoding: 'utf8' });
0
0
4
fs-extra.readFileSync is the most popular function in fs-extra (9724 examples)