how to create multiple folders at once in node js
'use strict';
const { mkdir } = require('fs').promises;
(async function main() {
try {
const parent = '.';
const dirnames = ['pdfs', 'fonts', 'err/or', 'users'];
await Promise.all(
dirnames.map(dirname => mkdir(`${parent}/${dirname}`).catch(console.error))
);
// All dirs are created here or errors reported.
} catch (err) {
console.error(err);
}
})();
Also in JavaScript:
- index and id together angularjs
- reactjs interview questions site: github
- plus minus hackerrank solution in javascript
- Javascript program printing the lyrics to the 99 bottles of beer song web
- how to use the match function in javascript for regex
- reverse a linked list js
- js set iframe src
- JavaScript function that generates all combinations of a string.
- jquery iterate obj
- how to refrence image in dart angular
- js detect mobile
- js go back
- jquery if else on click
- node js mongoose text index
- how to remove 000webhost watermark 2019
- javascript test for empty object
- package json scripts multiple commands
- how to use componentdidmount in functional component
- react if statement
- js loop over array of objects extract value
- how to get data in json format in javascript
- change the value in checkbox by button react
- node js store add values in file
- javascript sort alphabetically