Commit 48e76c43 authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent 281ddf29
......@@ -11,13 +11,16 @@ async function init() {
}
let files = await fs.readdirSync('format')
let prom=[]
for (let i = 0; i < files.length; i++) {
if (files[i].includes('.csv')) {
format(files[i])
prom.push(format(files[i]))
}
}
await Promise.all(prom)
}
......@@ -51,7 +54,7 @@ async function format(name) {
function createFile(name, body) {
return new Promise(function (resolve, reject) {
fs.writeFile('format/' + name, body, 'utf8', function (err) {
fs.writeFile('files/' + name, body, 'utf8', function (err) {
if (err) reject(err);
else resolve(true);
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment