How to use the ensureDirAsync function from fs-extra
Find comprehensive JavaScript fs-extra.ensureDirAsync code examples handpicked from public code repositorys.
GitHub: gpf0710/poi
90 91 92 93 94 95 96 97 98 99
] // *** TOOLS & COMMON METHODS *** const downloadAsync = async (url, destDir, filename = path.basename(url), description) => { log(`Downloading ${description} from ${url}`) await fs.ensureDirAsync(destDir) const destPath = path.join(destDir, filename) try { await fs.accessAsync(destPath, fs.R_OK) log(`Use existing ${destPath}`)
356
0
1
165 166 167 168 169 170 171 172 173 174
const runtime = target.function.runtime return this.wrap(wrapperDir, wrapperPy, this.libSubDir, target.realHandler).bind(this) .then(_.partial(this.fileAccessable, Path.join(wrapperDir, 'requirements.txt'))).bind(this) .then(_.partial(this.hard_remove, [wrapperPy, packagePath])) .then(() => { return Fse.ensureDirAsync(packagePath); }) .then(() => { return Fse.copyAsync( Path.join(__dirname, 'requirements.py'), requirementsPy); }).bind(this)
16
25
3
GitHub: opencollective/wiki
67 68 69 70 71 72 73 74 75 76
/** * i18n */ () => { console.info(colors.white(' └── ') + colors.green('Copying i18n client files...')) return fs.ensureDirAsync('./assets/js/i18n').then(() => { return fs.readJsonAsync('./server/locales/en/browser.json').then(enContent => { return fs.readdirAsync('./server/locales').then(langs => { return Promise.map(langs, lang => { console.info(colors.white(' ' + lang + '.json'))
0
1
4
+ 3 other calls in file
60 61 62 63 64 65 66 67 68 69 70 71 72
}, }; function ensureTypingDir(config) { return fs.ensureDirAsync(config.path); } function getServicesDeclare(config) { return getFiles(config.path)
0
0
0
+ 6 other calls in file
70 71 72 73 74 75 76 77 78 79
return jobs; })()); const downloadAsync = async (url, destDir, filename = path.basename(url), description) => { log(`Downloading ${description} from ${url}`); await fs.ensureDirAsync(destDir); const destPath = path.join(destDir, filename); try { await fs.accessAsync(destPath, fs.R_OK); log(`Use existing ${destPath}`);
0
0
2
+ 3 other calls in file
fs-extra.readFileSync is the most popular function in fs-extra (9724 examples)