Commit 21c1432d authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent d719c079
......@@ -14,12 +14,19 @@ async function init() {
let prom=[]
for (let i = 0; i < files.length; i++) {
if (files[i].includes('.csv')) {
prom.push(format(files[i]))
try {
await format(files[i] )
}
catch (e)
{
}
}
}
await Promise.all(prom)
// await Promise.all(prom)
}
......@@ -54,7 +61,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