I am getting an error that "directory is not defined" I really don't know if it means in my code or my json file. Here is the json file which I checked the format with https://jsonformatter.curiousconcept.com/
[
{
"directory": "C:\\Users\\PCAdmin\\Downloads\\jsonin",
"dirID": "dir01"
},
{
"directory": "C:\\Users\\PCAdmin\\Downloads\\jsonout",
"dirID": "dir02"
}
]
Here is my code which based on examples I've seen should work yet I can't seem to get past the error;
'use strict';
var fs = require('fs');
var jsonObj = require("./jsonDirectories.json");
for(directory in jsonObj) {
console.log("Dir: "+jsonObj.directory);
}
I'm sure it's something stupid but any direction would be appreciated