I use the following code to read json files from my node application folder. I've folder with json files and I want to read the content with the following code the proj built like following
myproj
folder1
file1
jsonFiles
json1.json
now from file1 I want to get json1,I try with the following which doesnt work..any idea?
glob("jsonFiles/*.json", function(err, files) {
files.forEach(function(file) {
fs.readFile(file, 'utf8', function (err, data) {
console.log("im here")
Im not able to reach the "im here" in the console,what it can be ? when I put Break-point I able to see get to fs.readFile but in the next line it doesnt stops and I dont get any error... UPD
in debug I see in file fs.readFile(file, 'utf8'
, the following path:jsonFiles/json1.json