Answer the question
In order to leave comments, you need to log in
Writing to a variable?
Hello.
There are 2 functions:
const getFile = async ()=>{
return await fs.readFile('file')
.then(data=>{ return data });
};
const getFileFunc = async ()=>{
const file = await getFile();
console.log(file); //выводит прочитанный файл
return file;
};
const file = getFileFunc();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question