the read file function does not return anything, but if it shows by console
function leer(archivo){
fs.readFile('./archivos/'+archivo, 'utf8',
function(err, data) {
return data;
}
);
};
when I use it from another file
console.log(escritorLector.leer(files[a]));
shows nothing
However, by console it looks good (in the same file).
function leer(archivo){
fs.readFile('./archivos/'+archivo, 'utf8',
function(err, data) {
console.log(data);
return data;
}
);
};