Open awinogradov opened 3 years ago
https://nodejs.org/api/fs.html#fs_fs_mkdirsync_path_options this will help
Да, но не для writeFile ;)
const writeFileRecursive = (file, data) => {
const dirname = path.dirname(file);
if (!fs.existsSync(dirname)) {
fs.mkdirSync(dirname, { recursive: true });
}
fs.writeFileSync(file, data);
};
Ну не охота же)